-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
312 lines (302 loc) · 10 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# This file is a template, and might need editing before it works on your project.
# see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
default:
timeout: 3 minutes
retry:
max: 1
when:
- stuck_or_timeout_failure
pre-commit:
tags:
- debian, docker, amd64
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_UTILS}"
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
image:
name: ${CI_REGISTRY}/internal/docker-utils:latest
script:
- pre-commit run --all-files --show-diff-on-failure
cache:
paths:
- ${PRE_COMMIT_HOME}
documentation:
tags:
- debian, docker, amd64
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_SPHINX}"
GIT_SUBMODULE_STRATEGY: "recursive"
image:
name: ${CI_REGISTRY}/internal/docker-sphinx:latest
script:
- cd docu/doxygen
- doxygen
- cp -r xml ../sphinx/source
- cd ../sphinx
- make html
- cd ../..
- DOXYGEN_LOG=docu/doxygen/doxygen.log
- if [[ -s ${DOXYGEN_LOG} ]]; then cat ${DOXYGEN_LOG}; exit 1; fi
- SPHINX_LOG=docu/sphinx/sphinx.log
- if [[ -s ${SPHINX_LOG} ]]; then cat ${SPHINX_LOG}; exit 1; fi
artifacts:
when: always
paths:
- docu/sphinx/build/html
- docu/doxygen/doxygen.log
- docu/sphinx/sphinx.log
testing:
tags:
- debian, docker, amd64
parallel:
matrix:
- IGOR_VERSION:
- 6
- 7
- 8
- 9
ARCHITECTURE:
- x86
- x64
EXPERIMENT:
- VeryTinyTestEnvironment.pxp
- Various.pxp
- UnitTests/UnitTests.pxp
# - IMUnitTests/IMUnitTests.pxp
- TestResultsTests/ResultsTest.pxp
- DebugModeTests.pxp
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_IGOR_PRO}"
rules:
- if: '$ARCHITECTURE == "x64"'
variables:
IGORTARGET: ""
IGOREXTPATH: "Igor Extensions (64-bit)"
- if: '$ARCHITECTURE == "x86"'
variables:
IGORTARGET: "--32bit"
IGOREXTPATH: "Igor Extensions"
image:
name: ${CI_REGISTRY}/internal/docker-igorpro:v${IGOR_VERSION}
script:
- test ${IGOR_VERSION} = "9" && mkdir -p "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/${IGOREXTPATH}" || true
- test ${IGOR_VERSION} = "9" && ln -rs xop/*.xop "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/${IGOREXTPATH}" || true
- ln -rs procedures "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures/iutf"
- ln -rs tests "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures/tests"
- touch "$(dirname "tests/$EXPERIMENT")/DO_AUTORUN.TXT"
- |
echo "COBERTURA_SOURCES=C:\\users\\igor\\My Documents\\WaveMetrics\\Igor Pro ${IGOR_VERSION} User Files\\User Procedures\\" \
> "$(dirname "tests/$EXPERIMENT")/TEST_VARS.TXT"
- igorpro execute ${IGORTARGET} --screenshot "tests/${EXPERIMENT}"
- if [[ "$(find tests -name "JU_*.xml" | wc -l)" == "0" ]]; then exit 1; fi
- exit $(grep -e "errors=\"[0-9]\+\"" -e "failures=\"[0-9]\+\"" tests/**/JU_*.xml | grep -cv "failures=\"0\" errors=\"0\"")
artifacts:
when: always
reports:
junit: tests/**/JU_*.xml
coverage_report:
coverage_format: cobertura
path: tests/**/Cobertura_*.xml
paths:
- tests/**/*.htm
- tests/**/*.log
- tests/**/JU_*.xml
- tests/**/Cobertura_*.xml
- screenshot/**/*.png
testing_nightly:
tags:
- debian, docker, amd64
parallel:
matrix:
- IGOR_VERSION:
- 9
ARCHITECTURE:
- x86
- x64
EXPERIMENT:
- VeryTinyTestEnvironment.pxp
- Various.pxp
- UnitTests/UnitTests.pxp
# - IMUnitTests/IMUnitTests.pxp
- Tracing.pxp
- TestResultsTests/ResultsTest.pxp
- DebugModeTests.pxp
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_IGOR_PRO}"
rules:
- if: '$ARCHITECTURE == "x64"'
variables:
IGORTARGET: ""
IGOREXTPATH: "Igor Extensions (64-bit)"
- if: '$ARCHITECTURE == "x86"'
variables:
IGORTARGET: "--32bit"
IGOREXTPATH: "Igor Extensions"
image:
name: ${CI_REGISTRY}/internal/docker-igorpro:nightly
script:
- mkdir -p "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/${IGOREXTPATH}"
- ln -rs xop/*.xop "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/${IGOREXTPATH}"
- ln -rs procedures "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures/iutf"
- ln -rs tests "/home/igor/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures/tests"
- touch "$(dirname "tests/$EXPERIMENT")/DO_AUTORUN.TXT"
- |
echo "COBERTURA_SOURCES=C:\\users\\igor\\My Documents\\WaveMetrics\\Igor Pro ${IGOR_VERSION} User Files\\User Procedures\\" \
> "$(dirname "tests/$EXPERIMENT")/TEST_VARS.TXT"
- igorpro execute ${IGORTARGET} --screenshot --verbose "tests/${EXPERIMENT}"
- if [[ "$(find tests -name "JU_*.xml" | wc -l)" == "0" ]]; then exit 1; fi
- exit $(grep -e "errors=\"[0-9]\+\"" -e "failures=\"[0-9]\+\"" tests/**/JU_*.xml | grep -cv "failures=\"0\" errors=\"0\"")
artifacts:
when: always
reports:
junit: tests/**/JU_*.xml
coverage_report:
coverage_format: cobertura
path: tests/**/Cobertura_*.xml
paths:
- tests/**/*.htm
- tests/**/*.log
- tests/**/JU_*.xml
- tests/**/Cobertura_*.xml
- screenshot/**/*.png
testing_macosx:
tags:
- macosx, igorpro, sonoma, arm64
variables:
GIT_SUBMODULE_STRATEGY: "recursive"
parallel:
matrix:
- IGOR_VERSION:
- 8
- 9
EXPERIMENT:
- VeryTinyTestEnvironment.pxp
- Various.pxp
- UnitTests/UnitTests.pxp
- IMUnitTests/IMUnitTests.pxp
- Tracing.pxp
- TestResultsTests/ResultsTest.pxp
- DebugModeTests.pxp
script:
- |
if [[ "$IGOR_VERSION" = "8" ]] && [[ "$EXPERIMENT" == "Tracing.pxp" ]]; then
echo "SKIP UNSUPPORTED TEST"
exit 0
fi
- rm -rf "$HOME/Documents/WaveMetrics"
- mkdir -p "$HOME/Documents/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/Igor Extensions (64-bit)"
- ln -s $(pwd)/xop/*.xop "$HOME/Documents/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/Igor Extensions (64-bit)"
- mkdir -p "$HOME/Documents/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures"
- ln -s $(pwd)/procedures "$HOME/Documents/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures/iutf"
- ln -s $(pwd)/tests "$HOME/Documents/WaveMetrics/Igor Pro ${IGOR_VERSION} User Files/User Procedures/tests"
- touch "$(dirname "tests/$EXPERIMENT")/DO_AUTORUN.TXT"
- |
echo "COBERTURA_SOURCES=Macintosh HD$(pwd | sed "s@/@:@g")" \
> "$(dirname "tests/$EXPERIMENT")/TEST_VARS.TXT"
- pwd
- /Applications/Igor\ Pro\ ${IGOR_VERSION}\ Folder/Igor64.app/Contents/MacOS/Igor64 /CompErrNoDialog /I tests/${EXPERIMENT}
- cd $(dirname "tests/$EXPERIMENT")
- if [[ "$(find . -name "JU_*.xml" | wc -l)" == "0" ]]; then exit 1; fi
- exit $(grep "errors\|failures=\"[0-9]\+\"" JU_*.xml | grep -cv "failures=\"0\" errors=\"0\"")
artifacts:
when: always
reports:
junit: tests/**/JU_*.xml
coverage_report:
coverage_format: cobertura
path: tests/**/Cobertura_*.xml
paths:
- tests/**/*.log
- tests/**/JU_*.xml
- tests/**/Cobertura_*.xml
- screenshot/**/*.png
xml_verification:
tags:
- debian, docker, amd64
image:
name: ${CI_REGISTRY}/internal/docker-utils:latest
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_UTILS}"
script:
- cd tests
- ./check-junit-xml-files.sh
needs:
- testing
- testing_nightly
- testing_macosx
generate_reports:
tags:
- debian, docker, amd64
image:
name: ${CI_REGISTRY}/internal/docker-utils:latest
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_UTILS}"
script:
- report_tag="$(git tag --points-at HEAD | head -n 1)"
- if [ -z "$report_tag" ]; then report_tag="$(git rev-parse --abbrev-ref HEAD)"; fi
- if [ -z "$report_tag" ] || [[ "$report_tag" == "HEAD" ]]; then report_tag="$(git rev-parse --short HEAD)"; fi
- |
for file in $(find . -name "Cobertura_*.xml"); do
sed -i -r "s@<source>.*</source>@<source>$(pwd)/</source>@" "$file"
sed -i 's@name="iutf@name="procedures@g' "$file"
done
- |
reportgenerator \
-reports:**/Cobertura_*.xml \
-targetdir:report \
"-reporttypes:Html;Badges" \
-verbosity:Info \
"-title:Igor Pro Universal Testing Framework" \
"-tag:$report_tag" \
--riskHotspotsAnalysisThresholds:metricThresholdForCyclomaticComplexity=20
needs:
- testing
- testing_nightly
- testing_macosx
artifacts:
when: always
paths:
- report/**/*
deployment_staging:
when: manual
tags:
- debian, docker, amd64
image:
name: ${CI_REGISTRY}/internal/docker-utils:latest
timeout: 10 minutes
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_UTILS}"
script:
- mv report docu/sphinx/build/html/
- cd docu/sphinx
- lftp -e "mirror --reverse -n -e build/html /igortest; bye" -u $FTP_USER_DOCS_STAGING,$FTP_PW_DOCS_STAGING byte-physics.de
needs:
- documentation
- generate_reports
deployment:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_COMMIT_BRANCH == "main"'
when: on_success
tags:
- debian, docker, amd64
image:
name: ${CI_REGISTRY}/internal/docker-utils:latest
timeout: 10 minutes
variables:
DOCKER_AUTH_CONFIG: "${DOCKER_AUTH_CONFIG_UTILS}"
script:
- mv report docu/sphinx/build/html/
- cd docu/sphinx
- lftp -e "mirror --reverse -n -e build/html /igortest; bye" -u $FTP_USER_DOCS,$FTP_PW_DOCS byte-physics.de
needs:
- documentation
- job: testing
artifacts: false
- job: testing_nightly
artifacts: false
- job: testing_macosx
artifacts: false
- job: pre-commit
artifacts: false
- generate_reports