-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
70 lines (64 loc) · 3.2 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
image: oarteam/batsim_ci:latest
variables:
GIT_SUBMODULE_STRATEGY: none
stages:
- big_stage
###############################################################################
# Build and test
###############################################################################
build_and_test:
stage: big_stage
script:
# Build Batsim
- export NIX_ARGS="--arg doUnitTests true --arg doCoverage true --arg debug true --arg werror true --arg coverageCoveralls true --argstr testVersion $(date +%s)"
- nix-shell --pure -A batsim ${NIX_ARGS} --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- nix-build -A batsim ${NIX_ARGS}
# Build doxygen documentation
- nix-shell --pure -A doxydoc --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- nix-build -A doxydoc && cp -rL result ./doxydoc_html
# Run integration tests
- nix-shell --pure -A integration_tests ${NIX_ARGS} --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- nix-build -A integration_tests ${NIX_ARGS} && cp -rL result ./integration_tests
- if [[ "$(cat ./integration_tests/pytest_returncode)" -ne 0 ]] ; then echo "pytest returned non-zero, aborting" ; exit 1 ; fi
# Generate a coverage report
- nix-shell --pure -A coverage-report ${NIX_ARGS} --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- nix-build -A coverage-report ${NIX_ARGS} && cp -rL result ./coverage_report
# Send coverage results to codecov.io
- nix-shell -A codecov_push_shell --command 'codecov -f ./coverage_report/coveralls.json'
artifacts:
when: always
expire_in: 8 hours
paths:
- /builds/batsim/batsim/doxydoc_html
- /builds/batsim/batsim/integration_tests
- /builds/batsim/batsim/coverage_report
###############################################################################
# Tutorials
###############################################################################
tuto_first_simulation-stable:
stage: big_stage
only:
- schedules
script:
- cd docs/tuto-first-simulation
- nix-shell --pure ./tuto-env.nix --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- nix-shell ./tuto-env.nix --command './run_simulation_manually.bash'
- nix-shell ./tuto-env.nix --command './run_simulation_robin.bash'
tuto_first_simulation-pinned:
stage: big_stage
only:
- schedules
script:
- cd docs/tuto-first-simulation
- nix-shell --pure ./tuto-env-pinned.nix --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- nix-shell ./tuto-env-pinned.nix --command './run_simulation_manually.bash'
- nix-shell ./tuto-env-pinned.nix --command './run_simulation_robin.bash'
tuto_first_simulation:
stage: big_stage
only:
- schedules
script:
- cd docs/tuto-first-simulation
- nix-shell --pure ./tuto-env-master.nix --command ${CI_PROJECT_DIR}/ci/list-store-paths-for-cachix.bash | cachix push batsim
- DO_NOT_CHECK_VERSION=1 nix-shell ./tuto-env-master.nix --command './run_simulation_manually.bash'
- DO_NOT_CHECK_VERSION=1 nix-shell ./tuto-env-master.nix --command './run_simulation_robin.bash'