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

stages:
  - build
Florian Hindenlang's avatar
Florian Hindenlang committed
4
  - clean_build_fail
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
13

# ---------------------------------------------------------------------------------------------------------------------------------
# Stage "build"
# ---------------------------------------------------------------------------------------------------------------------------------
build_debug:
  stage: build 
  script: 
Florian Hindenlang's avatar
Florian Hindenlang committed
14
    - rm -rf build_debug || true
Florian Hindenlang's avatar
Florian Hindenlang committed
15
    - mkdir -p build_debug
Florian Hindenlang's avatar
Florian Hindenlang committed
16
    - cd ode-1 ; make clean ; make DEBUG=yes 2>../build_debug/stderr 1>../build_debug/stdout
Florian Hindenlang's avatar
Florian Hindenlang committed
17
    - cat ../build_debug/stdout
Florian Hindenlang's avatar
Florian Hindenlang committed
18
    - cp rk_solve ../build_debug/.
Florian Hindenlang's avatar
Florian Hindenlang committed
19
  artifacts:
Florian Hindenlang's avatar
Florian Hindenlang committed
20
21
    untracked: true
    when: always
Florian Hindenlang's avatar
Florian Hindenlang committed
22
23
24
25
26
27
    paths:
    - build_debug

build_release:
  stage: build 
  script: 
Florian Hindenlang's avatar
Florian Hindenlang committed
28
    - rm -rf build_release || true
Florian Hindenlang's avatar
Florian Hindenlang committed
29
    - mkdir -p build_release
Florian Hindenlang's avatar
Florian Hindenlang committed
30
    - cd ode-1 ; make clean ; make DEBUG=no 2>../build_release/stderr 1>../build_release/stdout
Florian Hindenlang's avatar
Florian Hindenlang committed
31
    - cat ../build_debug/stdout
Florian Hindenlang's avatar
Florian Hindenlang committed
32
    - cp rk_solve ../build_release/.
Florian Hindenlang's avatar
Florian Hindenlang committed
33
  artifacts:
Florian Hindenlang's avatar
Florian Hindenlang committed
34
35
    untracked: true
    when: always
Florian Hindenlang's avatar
Florian Hindenlang committed
36
37
38
    paths:
    - build_release

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

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

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