forked from oar-team/batsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
173 lines (152 loc) · 5.67 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
image: oarteam/batsim_ci
variables:
GIT_SUBMODULE_STRATEGY: none
################################################################################
# Build stage
###############################################################################
build_clang:
stage: build
script:
- export CC=/usr/bin/clang
- export CXX=/usr/bin/clang++
- rm -rf /builds/batsim/batsim/build
- mkdir /builds/batsim/batsim/build
- cd /builds/batsim/batsim/build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -Dtreat_warnings_as_errors=ON
- make
artifacts:
paths:
- /builds/batsim/batsim/build
build_gcc:
stage: build
script:
- export CC=/usr/bin/gcc
- export CXX=/usr/bin/g++
- rm -rf /builds/batsim/batsim/build
- mkdir /builds/batsim/batsim/build
- cd /builds/batsim/batsim/build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -Dtreat_warnings_as_errors=ON
- make
build_batsched:
stage: build
script:
- rm -rf /builds/batsim/batsim/schedulers/batsched
# Get the code at the expected revision
- git clone https://gitlab.inria.fr/batsim/batsched.git /builds/batsim/batsim/schedulers/batsched
- cd /builds/batsim/batsim/schedulers/batsched
- git reset --hard 59f73b7 # 2017-10-07
# Build batsched
- rm -rf /builds/batsim/batsim/schedulers/batsched/build
- mkdir -p /builds/batsim/batsim/schedulers/batsched/build
- cd /builds/batsim/batsim/schedulers/batsched/build
- cmake /builds/batsim/batsim/schedulers/batsched
- make
artifacts:
paths:
- /builds/batsim/batsim/schedulers/batsched/build
retrieve_pybatsim:
stage: build
script:
- rm -rf /builds/batsim/batsim/schedulers/pybatsim
- git clone https://gitlab.inria.fr/batsim/pybatsim.git /builds/batsim/batsim/schedulers/pybatsim
- cd /builds/batsim/batsim/schedulers/pybatsim
- git reset --hard 3dd3fc0 # 2017-09-28
artifacts:
paths:
- /builds/batsim/batsim/schedulers/pybatsim
################################################################################
# Test stage
################################################################################
test_doc:
stage: test
script:
- cd /builds/batsim/batsim/doc
- doxygen
- cat doxygen_warnings.log
# The next line fails if doxygen generated warnings
- eval "[ $(wc -c doxygen_warnings.log | cut -d ' ' -f1) -eq 0 ]"
artifacts:
paths:
- /builds/batsim/batsim/doc/doxygen_doc/html
test_test:
stage: test
script:
# Install Batsim
- cd /builds/batsim/batsim/build
- make install
# Install the Batsched scheduler
- cd /builds/batsim/batsim/schedulers/batsched/build
- make install
# clean /tmp to fix https://gitlab.inria.fr/batsim/batsim/issues/27
- rm -rf /tmp/*
# Install the pybatsim scheduler
- cd /builds/batsim/batsim/schedulers/pybatsim
- python3 setup.py build
- python3 setup.py install
# Run the redis server
- |
redis-server>/dev/null &
while ! nc -z localhost 6379; do
sleep 1
done
# Finally run the tests
- cd /builds/batsim/batsim/build
- ctest --output-on-failure -E 'remote|smpi'
dependencies:
- build_clang
- build_batsched
- retrieve_pybatsim
test_version_git:
stage: test
script:
# Checks that 'batsim --version' matches the latest batsim release
- /builds/batsim/batsim/tools/check_batsim_version.py --batsim-command /builds/batsim/batsim/build/batsim --batsim-git-dir /builds/batsim/batsim
dependencies:
- build_clang
test_version_no_git:
stage: test
script:
# copy Batsim directory
- rm -rf /tmp/batsim
- mkdir /tmp/batsim
- cp -r {/builds/batsim/batsim,/tmp/batsim}/src
- cp -r {/builds/batsim/batsim,/tmp/batsim}/CMakeLists.txt
- cp -r {/builds/batsim/batsim,/tmp/batsim}/cmake
# compile Batsim outside the git directory
- export CC=/usr/bin/clang
- export CXX=/usr/bin/clang++
- rm -rf /tmp/batsim/build
- mkdir /tmp/batsim/build
- cd /tmp/batsim/build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -Dtreat_warnings_as_errors=ON
- make
# Checks that 'batsim --version' matches the latest batsim release
- /builds/batsim/batsim/tools/check_batsim_version.py --batsim-command /tmp/batsim/build/batsim --batsim-git-dir /builds/batsim/batsim
################################################################################
# Deploy stage
################################################################################
deploy_code_doc:
stage: deploy
script:
# The script below is done to push Batsim's code doc onto the gforge website.
# Information found on https://docs.gitlab.com/ee/ci/ssh_keys/README.html
# Install ssh-agent if not already installed, it is required by Docker.
# (change apt-get to yum if you use a CentOS-based image)
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
# you will overwrite your user's SSH config.
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
# Finally push the code documentation on the gforge website
- cd /builds/batsim/batsim/doc
- rsync -rlgoDz --delete doxygen_doc/html/ mpoquet@scm.gforge.inria.fr:/home/groups/batsim/htdocs
dependencies:
- test_doc
only:
- master