forked from project-fluxo/fluxo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
197 lines (181 loc) · 8 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# =================================================================================================================================
# Stages to be executed, each stage is a collection of jobs pointing to the stage
# =================================================================================================================================
stages:
- build
- short_runs
- cleanup
variables:
GIT_STRATEGY: none
GLOBAL_CACHE_PATH: "/home/gitlab-runner/globalcache/${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}"
SSH_GITLAB: "[email protected]:${CI_PROJECT_PATH}.git"
# =================================================================================================================================
# yaml variables
# hidden key that defines an anchor named 'job_def_build_intel'
# =================================================================================================================================
.job_template: &job_def_build_intel
stage: build
tags:
- vm_linux
before_script:
- pwd
- echo ${SSH_GITLAB} ${GLOBAL_CACHE_PATH}
- if [ ! -f .gitlab-ci.yml ] ; then # git repo does not exist
- cd .. ; rm -rf ${CI_PROJECT_NAME} ; git clone ${SSH_GITLAB} ${CI_PROJECT_NAME} ; fi # use ssh
- cd ${CI_PROJECT_DIR}
- git remote set-url origin ${SSH_GITLAB}
- git fetch origin
- git stash; git stash clear # be sure that its clean before checkout and pull
- git checkout ${CI_COMMIT_REF_NAME} ; git pull origin ${CI_COMMIT_REF_NAME}
- mkdir -p ${GLOBAL_CACHE_PATH}
- . ~/environments/modules_for_fluxo_intel ; pwd
#--------------------------------------------------------------------------------------------------------------------------------
.job_template: &job_def_short_runs_intel
stage: short_runs
tags:
- vm_linux
before_script:
- . ~/environments/modules_for_fluxo_intel ; pwd
#--------------------------------------------------------------------------------------------------------------------------------
.job_template: &job_def_cleanup
stage: cleanup
tags:
- vm_linux
# =================================================================================================================================
# Stage "build"
# artifacts: name: "${CI_PIPELINE_ID}_${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
#
# SHORT SYNTAX EXPLANATIONS FOR THE JOB, FOR DETAILS VISIT: ===> https://docs.gitlab.com/ce/ci/yaml/ <===
# "stage:" makes the job part of a stage defined above
# "tags:" selects the runner
# "only:" restricts the execution of the job to a git branch or tag
# "before_script:" shell commands to be executed before the main script.
# "script:" shell commands for the test. If a shell command exits with >0, the job is marked as "failed", else as "passed".
# commands after a failing one are not executed anymore!
# "after_script:" shell commands after passed OR failed script. Careful, the current directory is always the root of the repo!
# "artifacts:" keep data from the job which is uploaded to gitlab.com. You really should set a duration to expiration.
# "when:" can be either on_failure, on_success or always
# =================================================================================================================================
build_linadv:
<<: *job_def_build_intel # Merge the contents of the 'job_def_build_intel' alias
script:
- cd tests; pwd
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 100-199
- else python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 101,103 ; fi
- mv dirx_1* ${GLOBAL_CACHE_PATH}/.
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/log_1*.txt
#--------------------------------------------------------------------------------------------------------------------------------
build_maxwell:
<<: *job_def_build_intel
script:
- cd tests; pwd
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 200-299
- else python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 201 ; fi
- mv dirx_2* ${GLOBAL_CACHE_PATH}/.
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/log_2*.txt
#--------------------------------------------------------------------------------------------------------------------------------
build_mhd:
<<: *job_def_build_intel
script:
- cd tests; pwd
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 300-399
- else python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 301,304 ; fi
- mv dirx_3* ${GLOBAL_CACHE_PATH}/.
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/log_3*.txt
#--------------------------------------------------------------------------------------------------------------------------------
build_nav-st:
<<: *job_def_build_intel
script:
- cd tests; pwd
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 400-499
- else python build_tests.py -p 2 -stage 0 -buildhdf5 0 -case 401,403 ; fi
- mv dirx_4* ${GLOBAL_CACHE_PATH}/.
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/log_4*.txt
# =================================================================================================================================
# Stage "short_runs"
# =================================================================================================================================
short_runs_linadv:
<<: *job_def_short_runs_intel
script:
- cd tests; pwd
- rm -rf dirx_1* ; mv ${GLOBAL_CACHE_PATH}/dirx_1* .
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 2 -case 100-199
- else python build_tests.py -p 2 -stage 2 -case 101,103 ; fi
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/freestream/log_LINADV*.txt
#--------------------------------------------------------------------------------------------------------------------------------
short_runs_mhd:
<<: *job_def_short_runs_intel
script:
- cd tests; pwd
- rm -rf dirx_3*; mv ${GLOBAL_CACHE_PATH}/dirx_3* .
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 2 -case 300-399
- else python build_tests.py -p 2 -stage 2 -case 301,304 ; fi
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/freestream/log_MHD*.txt
#--------------------------------------------------------------------------------------------------------------------------------
short_runs_nav-st:
<<: *job_def_short_runs_intel
script:
- cd tests; pwd
- rm -rf dirx_4* ; mv ${GLOBAL_CACHE_PATH}/dirx_4* .
- if [ -n "${NIGHTLY_RUNNER}" ]; then python build_tests.py -p 2 -stage 2 -case 400-499
- else python build_tests.py -p 2 -stage 2 -case 401,403 ; fi
after_script:
- pwd
artifacts:
name: "${CI_PIPELINE_ID}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}"
expire_in: 1 hour
when: on_failure
paths:
- tests/freestream/log_NAVIERSTOKES*.txt
# =================================================================================================================================
# Stage "cleanup"
# =================================================================================================================================
cleanup_cache:
<<: *job_def_cleanup
when: always
script:
- pwd
- echo "remove:" ${GLOBAL_CACHE_PATH}
- rm -rf ${GLOBAL_CACHE_PATH}