-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
268 lines (228 loc) · 8.39 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
workflow:
rules:
# Run the CI on merge requests only
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
PACKAGE_BASE_NAME: gnatcoverage.tar.gz
PACKAGE_ABSOLUTE_NAME: $CI_PROJECT_DIR/$PACKAGE_BASE_NAME
include:
- component: $CI_SERVER_FQDN/eng/gitlab-templates/pre-commit@~latest
inputs:
stage: test
#TODO: workaround to allow dynamically setting the interruptible policy until https://gitlab.com/gitlab-org/gitlab/-/issues/194023 is implemented
- local: utils/ci/interruptible.yml
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
- project: eng/codepeer/ci-registry
file: /gnatsas-on-gnatcov.yml
.basic_setup: &basic_setup
- generic_anod_ci --add-dep eng/das/cov/gnatcoverage-extra
- cat /tmp/ci_env.sh
- . /tmp/ci_env.sh
stages:
- build
- test
- check
build:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: build
script:
- require_issue
- *basic_setup
# 1. Install / build the dependencies of gnatcov using the smart rebuilder
# to allow testing of breaking changes. Do not use the -Qinstr qualifier
# as this would trigger a rebuild of the vanilla gnatcov.
- anod build --smart-rebuild --deps-only gnatcov $ACI_TRACK_QUALIFIER
# 2. Install vanilla gnatcov from cathod
- anod install gnatcov $ACI_TRACK_QUALIFIER --latest
# 3. Build using anod, but minimally as all dependencies are supposed to be
# already built/installed via 1, but we don't want to re-build the
# gnatcov installed via 2 with --smart-rebuild.
- anod build --minimal gnatcov -Qinstr $ACI_TRACK_QUALIFIER
# Package all components created so far
- anod-copy-components --standalone-export $ANOD_DEFAULT_SANDBOX_DIR $ANOD_DEFAULT_SANDBOX_DIR/exp-comps
- tar czf $PACKAGE_ABSOLUTE_NAME -C / $ANOD_DEFAULT_SANDBOX_DIR/exp-comps
- cd $CI_PROJECT_DIR
- ls -l $PACKAGE_BASE_NAME
artifacts:
paths:
- $PACKAGE_BASE_NAME
build_docs:
stage: build
services:
- image:pe-base
needs: []
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" || ($CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)
changes:
- doc/**/*
when: always
script:
- *basic_setup
- anod build gnatdas-doc -Qwarn-errors --latest
- DOC_BSN=$(anod eval gnatdas-doc -Qwarn-errors build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$DOC_BSN/install/share/doc/gnatdas/ $CI_PROJECT_DIR
artifacts:
when:
always
paths:
- gnatdas/pdf/gnatdas.pdf
- gnatdas/html
build_community:
interruptible: true
services:
- image:pe-base
- cpu:8
- mem:16
stage: test
script:
- *basic_setup
# Build using anod, we can use the smart rebuilder here as gnatcov does not
# depend on itself in this case.
- anod build --smart-rebuild gnatcov -Qno-c $ACI_TRACK_QUALIFIER
.common_test_bits: &basic_test_setup
# Setup the sandbox
- *basic_setup
# Import components from the artifact and install the instrumented gnatcov,
# then remove temporaries to save disk space.
- tar zxf $PACKAGE_ABSOLUTE_NAME -C /
- anod-copy-components $ANOD_DEFAULT_SANDBOX_DIR/exp-comps $ANOD_DEFAULT_SANDBOX_DIR
- anod install gnatcov -Qinstr $ACI_TRACK_QUALIFIER
- rm -rf $PACKAGE_ABSOLUTE_NAME $ANOD_DEFAULT_SANDBOX_DIR/exp-comps
# Setup the CI directory to host coverage results
- mkdir $CI_PROJECT_DIR/coverage
.common_artifacts_bits: &artifacts
artifacts:
paths:
- xunit-*.xml
- coverage/cobertura.xml
reports:
junit: xunit-*.xml
coverage_report:
coverage_format: cobertura
path: coverage/cobertura.xml
test_bin_traces:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: test
script:
- *basic_test_setup
# Test using anod
- anod test gnatcov --minimal --target=leon3-elf,,qemu -QRTS=embedded-leon3,-O0,instr $ACI_TRACK_QUALIFIER
- TEST_BSN=$(anod eval --primitive=test gnatcov --target=leon3-elf,,qemu -QRTS=embedded-leon3,-O0,instr $ACI_TRACK_QUALIFIER build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/leon3-elf-linux64/$TEST_BSN/test/coverage/cobertura.xml $CI_PROJECT_DIR/coverage/cobertura.xml
- testsuite_reports
<<: *artifacts
test_src_traces:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: test
script:
- *basic_test_setup
# Test using anod
- anod test gnatcov --minimal -Qsrc-traces,instr $ACI_TRACK_QUALIFIER
- TEST_BSN=$(anod eval --primitive=test gnatcov -Qsrc-traces,instr $ACI_TRACK_QUALIFIER build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$TEST_BSN/test/coverage/cobertura.xml $CI_PROJECT_DIR/coverage/cobertura.xml
- testsuite_reports
<<: *artifacts
test_5.04a1_src_traces:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: test
script:
- *basic_test_setup
# GNAT 5.04a1 does not ship "ar" nor "ld". Make the ones from gnat/stable
# available as if they were installed system-wide.
- anod install gnat -Qstable
- STABLE_GNAT_BSN=$(anod eval --primitive=install gnat -Qstable build_space_name)
- STABLE_GNAT_PREFIX="$ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$STABLE_GNAT_BSN/install"
- mkdir build-essentials
- export PATH="$PWD/build-essentials:$PATH"
- ln -s $STABLE_GNAT_PREFIX/bin/ar build-essentials/
- ln -s $STABLE_GNAT_PREFIX/x86_64-pc-linux-gnu/bin/ld build-essentials/
# Test using anod
- anod test gnatcov --minimal -Q5.04a1,src-traces,instr $ACI_TRACK_QUALIFIER
- TEST_BSN=$(anod eval --primitive=test gnatcov -Q5.04a1,src-traces,instr $ACI_TRACK_QUALIFIER build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$TEST_BSN/test/coverage/cobertura.xml $CI_PROJECT_DIR/coverage/cobertura.xml
- testsuite_reports
<<: *artifacts
test_spark:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: test
script:
- *basic_test_setup
# Test using anod
- anod test gnatcov --minimal -Qspark-tests,src-traces,instr $ACI_TRACK_QUALIFIER
- TEST_BSN=$(anod eval --primitive=test gnatcov -Qspark-tests,src-traces,instr $ACI_TRACK_QUALIFIER build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$TEST_BSN/test/coverage/cobertura.xml $CI_PROJECT_DIR/coverage/cobertura.xml
- testsuite_reports
<<: *artifacts
pre-commit:
before_script:
- *basic_setup
# Install the clang-format executable and make it available
- anod install libclang -Qstable
- eval `anod printenv libclang -Qstable`
#################
# Optional jobs #
#################
# Optional job for block instrumentation.
#
# To be run when Ada or C instrumentation is modified to ensure the new
# changes are also compatible with block instrumentation.
test_block_instr:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: test
when: manual
script:
- *basic_test_setup
# Test using anod
- anod test gnatcov --minimal -Qsrc-traces,instr,block $ACI_TRACK_QUALIFIER
- TEST_BSN=$(anod eval --primitive=test gnatcov -Qsrc-traces,instr,block $ACI_TRACK_QUALIFIER build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$TEST_BSN/test/coverage/cobertura.xml $CI_PROJECT_DIR/coverage/cobertura.xml
- testsuite_reports
<<: *artifacts
# Optional job for light runtime testing on source traces. Dump trigger
# strategies differ on that runtime, and not all tests are compatible with
# this runtime depending on the needed features (e.g. --dump-channel=bin-file)
# or the test sources make use of Ada features not available on this runtime.
#
# Only needs to be run when large batches of src-trace specific tests are added,
# or if instrumentation code related to buffer dump is modified.
test_src_light:
interruptible: true
services:
- image:pe-base
- cpu:16
- mem:16
stage: test
when: manual
script:
- *basic_test_setup
# Test using anod
- anod test gnatcov --minimal -Qsrc-traces,instr,RTS=light-stm32f4 --target=arm-elf,,qemu-stm32 $ACI_TRACK_QUALIFIER
- TEST_BSN=$(anod eval --primitive=test gnatcov -Qsrc-traces,instr,RTS=light-stm32f4 --target=arm-elf,,qemu-stm32 $ACI_TRACK_QUALIFIER build_space_name)
- mv $ANOD_DEFAULT_SANDBOX_DIR/x86_64-linux/$TEST_BSN/test/coverage/cobertura.xml $CI_PROJECT_DIR/coverage/cobertura.xml
- testsuite_reports
<<: *artifacts