.gitlab-ci.yml 2.55 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
    - cd ode-1 ; make clean ; make DEBUG=yes 2>stderr 1>stdout
Florian Hindenlang's avatar
Florian Hindenlang committed
15
    - cat stdout; cat stderr
Florian Hindenlang's avatar
Florian Hindenlang committed
16
17
18
    - cd .. ; rm -rf build_debug || true
    - mkdir -p build_debug
    - cp ode-1/rk_solve build_debug/.
Florian Hindenlang's avatar
Florian Hindenlang committed
19
    - cp ode-1/std* build_debug/.
Florian Hindenlang's avatar
Florian Hindenlang committed
20
  artifacts:
Florian Hindenlang's avatar
Florian Hindenlang committed
21
22
    untracked: true
    when: always
Florian Hindenlang's avatar
Florian Hindenlang committed
23
24
25
26
27
28
    paths:
    - build_debug

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

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

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

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