stages: - build - clean_build_fail - test - final_clean cache: key: "$CI_BUILD_REF" paths: - build_debug/ - build_release/ - testing/ # --------------------------------------------------------------------------------------------------------------------------------- # 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 # --------------------------------------------------------------------------------------------------------------------------------- # Stage "error_clean_build": delete build folders if previous builds fail and exit # --------------------------------------------------------------------------------------------------------------------------------- clean_build: stage: clean_build_fail script: - rm -rf build_* when: on_failure # --------------------------------------------------------------------------------------------------------------------------------- # Stage "test" # --------------------------------------------------------------------------------------------------------------------------------- test_debug: stage: test script: - cd testing ; python3 run_tests.py -execpath build_debug/rk_solve artifacts: untracked: true when: always paths: - testing test_release: stage: test script: - cd testing ; python3 run_tests.py -execpath build_release/rk_solve artifacts: untracked: true when: always paths: - testing # --------------------------------------------------------------------------------------------------------------------------------- # Stage "final_clean": delete build folders if previous builds fail and exit # --------------------------------------------------------------------------------------------------------------------------------- clean_all: stage: final_clean script: - rm -rf build_* - cd testing - rm -rf dirx_* when: on_success