blob: 0466c096dac2458201eb2033ddec7a60795f42a7 [file] [log] [blame]
Andrew Geissler220dafd2023-10-04 10:18:08 -05001image: ${MIRROR_GHCR}/siemens/kas/kas:4.0
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002
Andrew Geissler517393d2023-01-13 08:55:19 -06003variables:
4 CPU_REQUEST: ""
5 DEFAULT_TAG: ""
Andrew Geissler9347dd42023-03-03 12:38:41 -06006 CACHE_DIR: $CI_BUILDS_DIR/persist
Andrew Geissler220dafd2023-10-04 10:18:08 -05007 MIRROR_GHCR: ghcr.io
Andrew Geissler517393d2023-01-13 08:55:19 -06008 # These are needed as the k8s executor doesn't respect the container entrypoint
9 # by default
10 FF_KUBERNETES_HONOR_ENTRYPOINT: 1
11 FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
12
Brad Bishopbec4ebc2022-08-03 09:55:16 -040013stages:
14 - prep
15 - build
16
17# Common job fragment to get a worker ready
18.setup:
Andrew Geissler517393d2023-01-13 08:55:19 -060019 tags:
20 - $DEFAULT_TAG
Brad Bishopbec4ebc2022-08-03 09:55:16 -040021 stage: build
22 interruptible: true
23 variables:
24 KAS_WORK_DIR: $CI_PROJECT_DIR/work
Andrew Geissler9347dd42023-03-03 12:38:41 -060025 KAS_REPO_REF_DIR: $CACHE_DIR/repos
26 SSTATE_DIR: $CACHE_DIR/sstate
27 DL_DIR: $CACHE_DIR/downloads
Brad Bishopbec4ebc2022-08-03 09:55:16 -040028 BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
Andrew Geissler9347dd42023-03-03 12:38:41 -060029 TOOLCHAIN_DIR: $CACHE_DIR/toolchains
Brad Bishopbec4ebc2022-08-03 09:55:16 -040030 IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
31 TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
32 before_script:
33 - echo KAS_WORK_DIR = $KAS_WORK_DIR
34 - echo SSTATE_DIR = $SSTATE_DIR
35 - echo DL_DIR = $DL_DIR
36 - rm -rf $KAS_WORK_DIR
37 - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
38 # Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
39 - ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
Brad Bishopbec4ebc2022-08-03 09:55:16 -040040
41# Generalised fragment to do a Kas build
42.build:
43 extends: .setup
Andrew Geissler517393d2023-01-13 08:55:19 -060044 variables:
45 KUBERNETES_CPU_REQUEST: $CPU_REQUEST
Patrick Williams8e7b46e2023-05-01 14:19:06 -050046 rules:
47 # Don't run MR pipelines
48 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
49 when: never
50 # Don't run pipelines for tags
51 - if: $CI_COMMIT_TAG
52 when: never
53 # Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
54 - if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
55 when: never
56 # Allow the dev kernels to fail and not fail the overall build
57 - if: '$KERNEL == "linux-yocto-dev"'
58 allow_failure: true
59 # Catch all for everything else
60 - if: '$KERNEL != "linux-yocto-dev"'
Brad Bishopbec4ebc2022-08-03 09:55:16 -040061 script:
Andrew Geissler23e02792023-07-21 09:06:10 -050062 - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME"):lockfile.yml
63 - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
Brad Bishopbec4ebc2022-08-03 09:55:16 -040064 - kas build $KASFILES
65 - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
66 artifacts:
67 name: "logs"
Patrick Williams520786c2023-06-25 16:20:36 -050068 when: always
Brad Bishopbec4ebc2022-08-03 09:55:16 -040069 paths:
70 - $CI_PROJECT_DIR/work/build/tmp/work*/**/temp/log.do_*.*
Andrew Geissler9347dd42023-03-03 12:38:41 -060071 - $CI_PROJECT_DIR/work/build/tmp/work*/**/testimage/*
Brad Bishopbec4ebc2022-08-03 09:55:16 -040072
73#
Andrew Geissler2daf84b2023-03-31 09:57:23 -050074# Prep stage, update repositories once.
75# Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch
Brad Bishopbec4ebc2022-08-03 09:55:16 -040076#
77update-repos:
78 extends: .setup
79 stage: prep
Andrew Geissler220dafd2023-10-04 10:18:08 -050080 allow_failure:
81 exit_codes: 128
Brad Bishopbec4ebc2022-08-03 09:55:16 -040082 script:
Andrew Geissler23e02792023-07-21 09:06:10 -050083 - |
84 flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
85 # Only generate if doesn't already exist, to allow feature branches to drop one in.
86 if test -f lockfile.yml; then
87 echo Using existing lockfile.yml
88 else
89 # Be sure that this is the complete list of layers being fetched
90 kas dump --lock --update ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/clang.yml:ci/meta-virtualization.yml | tee lockfile.yml
91 fi
92 artifacts:
93 name: "lockfile"
94 paths:
95 - lockfile.yml
Brad Bishopbec4ebc2022-08-03 09:55:16 -040096
97#
98# Build stage, the actual build jobs
99#
100# Available options for building are
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500101# DISTRO: [poky, poky-tiny]
102# KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williams520786c2023-06-25 16:20:36 -0500103# TOOLCHAINS: [gcc, clang, external-gccarm]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400104# TCLIBC: [glibc, musl]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500105# FIRMWARE: [u-boot, edk2]
106# TS: [none, trusted-services]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400107# VIRT: [none, xen]
108# TESTING: testimage
109
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400110corstone1000-fvp:
111 extends: .build
112 parallel:
113 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500114 - TESTING: [testimage, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400115 tags:
116 - x86_64
117
118corstone1000-mps3:
119 extends: .build
120
121fvp-base:
122 extends: .build
123 parallel:
124 matrix:
125 - TESTING: testimage
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500126 - FIRMWARE: edk2
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400127
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400128fvps:
129 extends: .build
130
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400131generic-arm64:
132 extends: .build
133
134juno:
135 extends: .build
136 parallel:
137 matrix:
138 - TOOLCHAINS: [gcc, clang]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500139 FIRMWARE: [u-boot, edk2]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400140
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400141musca-b1:
142 extends: .build
143
144musca-s1:
145 extends: .build
146
147n1sdp:
148 extends: .build
149 parallel:
150 matrix:
Patrick Williams520786c2023-06-25 16:20:36 -0500151 - TS: [none, n1sdp-ts]
Andrew Geissler2edf0642023-09-11 08:24:07 -0400152 - OPTEE: [none, n1sdp-optee]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400153
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400154qemu-generic-arm64:
155 extends: .build
156 parallel:
157 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500158 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
159 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400160 TESTING: testimage
161
162qemuarm64-secureboot:
163 extends: .build
164 parallel:
165 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500166 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
167 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400168 TCLIBC: [glibc, musl]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500169 TS: [none, qemuarm64-secureboot-ts]
Patrick Williams92b42cb2022-09-03 06:53:57 -0500170 TESTING: testimage
171
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400172qemuarm64:
173 extends: .build
174 parallel:
175 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500176 - DISTRO: poky
177 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
178 TOOLCHAINS: [gcc, clang]
179 FIRMWARE: [u-boot, edk2]
180 TESTING: testimage
181 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400182 TESTING: testimage
183 - VIRT: xen
184
185qemuarm-secureboot:
186 extends: .build
187 parallel:
188 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500189 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500190 TOOLCHAINS: [gcc, clang]
191 TCLIBC: [glibc, musl]
192 TESTING: testimage
193 - TOOLCHAINS: external-gccarm
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400194 TESTING: testimage
195
196qemuarm:
197 extends: .build
198 parallel:
199 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500200 - DISTRO: poky
201 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
202 TOOLCHAINS: [gcc, clang]
203 FIRMWARE: [u-boot, edk2]
204 TESTING: testimage
205 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400206 TESTING: testimage
207 - VIRT: xen
208
209qemuarmv5:
210 extends: .build
211 parallel:
212 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500213 - DISTRO: poky
214 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
215 TESTING: testimage
216 - DISTRO: poky-tiny
217 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400218
219sgi575:
220 extends: .build
221
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400222tc1:
223 extends: .build
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500224 parallel:
225 matrix:
226 - TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400227 tags:
228 - x86_64
229
230toolchains:
231 extends: .build
232
233selftest:
234 extends: .setup
235 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500236 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400237 - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 1 --run-tests runfvp'
238
239# Validate layers are Yocto Project Compatible
240check-layers:
241 extends: .setup
242 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500243 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400244 "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
245 parallel:
246 matrix:
Andrew Geissler517393d2023-01-13 08:55:19 -0600247 - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400248
249pending-updates:
250 extends: .setup
251 artifacts:
252 paths:
253 - update-report
254 script:
255 - rm -fr update-report
256 # This configuration has all of the layers we need enabled
Andrew Geissler23e02792023-07-21 09:06:10 -0500257 - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Andrew Geissler517393d2023-01-13 08:55:19 -0600258 "$CI_PROJECT_DIR/scripts/machine-summary.py -t report -o $CI_PROJECT_DIR/update-report $($CI_PROJECT_DIR/ci/listmachines.py meta-arm meta-arm-bsp)"
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400259 # Do this on x86 whilst the compilers are x86-only
260 tags:
261 - x86_64
262
263# What percentage of machines in the layer do we build
264machine-coverage:
Andrew Geissler517393d2023-01-13 08:55:19 -0600265 extends: .setup
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400266 script:
267 - ./ci/check-machine-coverage
268 coverage: '/Coverage: \d+/'
269
270metrics:
271 extends: .setup
272 artifacts:
273 reports:
274 metrics: metrics.txt
275 script:
276 - kas shell --update --force-checkout ci/base.yml --command \
277 "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500278
279documentation:
280 extends: .setup
281 script:
282 - |
Andrew Geissler220dafd2023-10-04 10:18:08 -0500283 # This can be removed when the kas container has python3-venv installed
284 sudo apt-get update && sudo apt-get install --yes python3-venv
285
286 python3 -m venv venv
287 . ./venv/bin/activate
288
289 pip3 install -r meta-arm-bsp/documentation/requirements.txt
290
Patrick Williams2390b1b2022-11-03 13:47:49 -0500291 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500292 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500293 SOURCE_DIR=$(dirname $CONF)
294 MACHINE=$(basename $SOURCE_DIR)
295 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
296 done
297 test -d build-docs/
298 artifacts:
299 paths:
300 - build-docs/