.gitlab-ci.yml 2.43 KB
Newer Older
Florian Hindenlang's avatar
Florian Hindenlang committed
1
2
3

stages:
  - build
Florian Hindenlang's avatar
Florian Hindenlang committed
4
  - error_clean_build
Florian Hindenlang's avatar
Florian Hindenlang committed
5
  - test
Florian Hindenlang's avatar
Florian Hindenlang committed
6
  - final_clean
Florian Hindenlang's avatar
Florian Hindenlang committed
7
8
9
10
11
12

cache:
  key: "$CI_BUILD_REF"
  paths: 
    - build_debug/    
    - build_release/ 
Florian Hindenlang's avatar
Florian Hindenlang committed
13
    - testing/ 
Florian Hindenlang's avatar
Florian Hindenlang committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

# ---------------------------------------------------------------------------------------------------------------------------------
# Stage "build"
# ---------------------------------------------------------------------------------------------------------------------------------
build_debug:
  stage: build 
  script: 
    - cd ode-1 ; make clean ; make DEBUG=yes
    - cd .. ; rm -rf build_debug || true
    - mkdir -p build_debug
    - cp ode-1/rk_solve build_debug/.
  artifacts:
    paths:
    - build_debug
    untracked: true

build_release:
  stage: build 
  script: 
    - cd ode-1 ; make clean ; make DEBUG=no
    - cd .. ; rm -rf build_release || true
    - mkdir -p build_release
    - cp ode-1/rk_solve build_release/.
  artifacts:
    paths:
    - build_release
    untracked: true

Florian Hindenlang's avatar
Florian Hindenlang committed
42
43
44
45
46
47
48
49
50
# ---------------------------------------------------------------------------------------------------------------------------------
# Stage "error_clean_build": delete build folders if previous builds fail and exit
# ---------------------------------------------------------------------------------------------------------------------------------
clean_build:
  stage: error_clean_build
  script:
    - rm -rf build_*
  when: on_failure

Florian Hindenlang's avatar
Florian Hindenlang committed
51
52
53
54
55
56
# ---------------------------------------------------------------------------------------------------------------------------------
# Stage "test" 
# ---------------------------------------------------------------------------------------------------------------------------------
test_debug:
  stage: test
  script: 
Florian Hindenlang's avatar
Florian Hindenlang committed
57
    - cd testing ; python3 run_test.py -execpath build_debug/rk_solve
Florian Hindenlang's avatar
Florian Hindenlang committed
58
59
  artifacts:
    paths:
Florian Hindenlang's avatar
Florian Hindenlang committed
60
    - testing
Florian Hindenlang's avatar
Florian Hindenlang committed
61
62
    untracked: true

Florian Hindenlang's avatar
Florian Hindenlang committed
63
test_debug:
Florian Hindenlang's avatar
Florian Hindenlang committed
64
65
  stage: test
  script: 
Florian Hindenlang's avatar
Florian Hindenlang committed
66
    - cd testing ; python3 run_test.py -execpath build_release/rk_solve
Florian Hindenlang's avatar
Florian Hindenlang committed
67
68
  artifacts:
    paths:
Florian Hindenlang's avatar
Florian Hindenlang committed
69
    - testing
Florian Hindenlang's avatar
Florian Hindenlang committed
70
    untracked: true
Florian Hindenlang's avatar
Florian Hindenlang committed
71
72
73
74
75
76
77
78
79
80
# ---------------------------------------------------------------------------------------------------------------------------------
# Stage "final_clean": delete build folders if previous builds fail and exit
# ---------------------------------------------------------------------------------------------------------------------------------
clean_build:
  stage: error_clean_test
  script:
    - rm -rf build_*
    - cd testing
    - rm -rf dirx_*
  when: on_success