blob: 4f16fcf31833bf73403319c8625ffb005e227159 [file] [log] [blame]
Patrick Williams44b3caf2024-04-12 16:51:14 -05001image: ${MIRROR_GHCR}/siemens/kas/kas:4.3.2
Brad Bishopbec4ebc2022-08-03 09:55:16 -04002
Andrew Geissler517393d2023-01-13 08:55:19 -06003variables:
Patrick Williams73bd93f2024-02-20 08:07:48 -06004 # These are needed as the k8s executor doesn't respect the container
5 # entrypoint by default
Andrew Geissler517393d2023-01-13 08:55:19 -06006 FF_KUBERNETES_HONOR_ENTRYPOINT: 1
7 FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
Patrick Williams73bd93f2024-02-20 08:07:48 -06008 # The default value for KUBERNETES_CPU_REQUEST
9 CPU_REQUEST: ""
10 # The default machine tag for the build jobs
11 DEFAULT_TAG: ""
12 # The machine tag for the ACS test jobs
Patrick Williams169d7bc2024-01-05 11:33:25 -060013 ACS_TAG: ""
Patrick Williams73bd93f2024-02-20 08:07:48 -060014 # The directory to use as the persistent cache (the root for DL_DIR, SSTATE_DIR, etc)
15 CACHE_DIR: $CI_BUILDS_DIR/persist
16 # The container mirror to use
17 MIRROR_GHCR: ghcr.io
18 # Whether to run the SystemReady ACS tests
19 ACS_TEST: 0
20 # The list of extra Kas fragments to be used when building
21 EXTRA_KAS_FILES: ""
22 # The NVD API key to use when fetching CVEs
23 NVDCVE_API_KEY: ""
Andrew Geissler517393d2023-01-13 08:55:19 -060024
Brad Bishopbec4ebc2022-08-03 09:55:16 -040025stages:
26 - prep
27 - build
28
29# Common job fragment to get a worker ready
30.setup:
Andrew Geissler517393d2023-01-13 08:55:19 -060031 tags:
32 - $DEFAULT_TAG
Brad Bishopbec4ebc2022-08-03 09:55:16 -040033 stage: build
34 interruptible: true
35 variables:
36 KAS_WORK_DIR: $CI_PROJECT_DIR/work
Andrew Geissler9347dd42023-03-03 12:38:41 -060037 KAS_REPO_REF_DIR: $CACHE_DIR/repos
38 SSTATE_DIR: $CACHE_DIR/sstate
39 DL_DIR: $CACHE_DIR/downloads
Brad Bishopbec4ebc2022-08-03 09:55:16 -040040 BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
Andrew Geissler9347dd42023-03-03 12:38:41 -060041 TOOLCHAIN_DIR: $CACHE_DIR/toolchains
Brad Bishopbec4ebc2022-08-03 09:55:16 -040042 IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
43 TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
44 before_script:
45 - echo KAS_WORK_DIR = $KAS_WORK_DIR
46 - echo SSTATE_DIR = $SSTATE_DIR
47 - echo DL_DIR = $DL_DIR
48 - rm -rf $KAS_WORK_DIR
49 - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
50 # Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
51 - ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
Brad Bishopbec4ebc2022-08-03 09:55:16 -040052
53# Generalised fragment to do a Kas build
54.build:
55 extends: .setup
Andrew Geissler517393d2023-01-13 08:55:19 -060056 variables:
57 KUBERNETES_CPU_REQUEST: $CPU_REQUEST
Patrick Williams8e7b46e2023-05-01 14:19:06 -050058 rules:
59 # Don't run MR pipelines
60 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
61 when: never
62 # Don't run pipelines for tags
63 - if: $CI_COMMIT_TAG
64 when: never
65 # Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
66 - if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
67 when: never
68 # Allow the dev kernels to fail and not fail the overall build
69 - if: '$KERNEL == "linux-yocto-dev"'
70 allow_failure: true
71 # Catch all for everything else
72 - if: '$KERNEL != "linux-yocto-dev"'
Brad Bishopbec4ebc2022-08-03 09:55:16 -040073 script:
Patrick Williams73bd93f2024-02-20 08:07:48 -060074 - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME" $EXTRA_KAS_FILES):lockfile.yml
Andrew Geissler23e02792023-07-21 09:06:10 -050075 - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
Brad Bishopbec4ebc2022-08-03 09:55:16 -040076 - kas build $KASFILES
77 - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
78 artifacts:
79 name: "logs"
Patrick Williams520786c2023-06-25 16:20:36 -050080 when: always
Brad Bishopbec4ebc2022-08-03 09:55:16 -040081 paths:
Patrick Williams169d7bc2024-01-05 11:33:25 -060082 - $CI_PROJECT_DIR/work/build/tmp*/work*/**/temp/log.do_*.*
83 - $CI_PROJECT_DIR/work/build/tmp*/work*/**/testimage/*
Brad Bishopbec4ebc2022-08-03 09:55:16 -040084
85#
Andrew Geissler2daf84b2023-03-31 09:57:23 -050086# Prep stage, update repositories once.
87# Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch
Brad Bishopbec4ebc2022-08-03 09:55:16 -040088#
89update-repos:
90 extends: .setup
91 stage: prep
Andrew Geissler220dafd2023-10-04 10:18:08 -050092 allow_failure:
93 exit_codes: 128
Brad Bishopbec4ebc2022-08-03 09:55:16 -040094 script:
Andrew Geissler23e02792023-07-21 09:06:10 -050095 - |
96 flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
97 # Only generate if doesn't already exist, to allow feature branches to drop one in.
98 if test -f lockfile.yml; then
99 echo Using existing lockfile.yml
100 else
101 # Be sure that this is the complete list of layers being fetched
102 kas dump --lock --update ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/clang.yml:ci/meta-virtualization.yml | tee lockfile.yml
103 fi
104 artifacts:
105 name: "lockfile"
106 paths:
107 - lockfile.yml
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400108
109#
110# Build stage, the actual build jobs
111#
112# Available options for building are
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500113# DISTRO: [poky, poky-tiny]
114# KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williams520786c2023-06-25 16:20:36 -0500115# TOOLCHAINS: [gcc, clang, external-gccarm]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400116# TCLIBC: [glibc, musl]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500117# FIRMWARE: [u-boot, edk2]
118# TS: [none, trusted-services]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400119# VIRT: [none, xen]
120# TESTING: testimage
121
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400122corstone1000-fvp:
123 extends: .build
124 parallel:
125 matrix:
Patrick Williams39653562024-03-01 08:54:02 -0600126 - FIRMWARE: corstone1000-firmware-only
127 TESTING: [testimage, tftf]
128 - FIRMWARE: none
129 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400130
131corstone1000-mps3:
132 extends: .build
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600133 parallel:
134 matrix:
Patrick Williams39653562024-03-01 08:54:02 -0600135 - FIRMWARE: corstone1000-firmware-only
136 TESTING: [none, tftf]
137 - FIRMWARE: none
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400138
139fvp-base:
140 extends: .build
141 parallel:
142 matrix:
143 - TESTING: testimage
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500144 - FIRMWARE: edk2
Patrick Williams169d7bc2024-01-05 11:33:25 -0600145 - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
146
147arm-systemready-ir-acs:
148 extends: .build
149 timeout: 12h
150 parallel:
151 matrix:
152 # arm-systemready-ir-acs must be specified after fvp-base for ordering
153 # purposes for the jobs-to-kas output. It is not enough to just have it
154 # in the job name because fvp-base.yml overwrites the target.
155 - PLATFORM: fvp-base
156 ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
157 tags:
158 - ${ACS_TAG}
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400159
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400160fvps:
161 extends: .build
162
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400163generic-arm64:
164 extends: .build
165
166juno:
167 extends: .build
168 parallel:
169 matrix:
170 - TOOLCHAINS: [gcc, clang]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500171 FIRMWARE: [u-boot, edk2]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400172
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400173musca-b1:
174 extends: .build
175
176musca-s1:
177 extends: .build
178
179n1sdp:
180 extends: .build
181 parallel:
182 matrix:
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600183 - TESTING: [none, n1sdp-ts, n1sdp-optee, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400184
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400185qemu-generic-arm64:
186 extends: .build
187 parallel:
188 matrix:
Patrick Williams03514f12024-04-05 07:04:11 -0500189 - KERNEL: [linux-yocto, linux-yocto-rt]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500190 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400191 TESTING: testimage
Patrick Williams03514f12024-04-05 07:04:11 -0500192 - KERNEL: linux-yocto-dev
193 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400194
195qemuarm64-secureboot:
196 extends: .build
197 parallel:
198 matrix:
Patrick Williams03514f12024-04-05 07:04:11 -0500199 - KERNEL: [linux-yocto, linux-yocto-rt]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500200 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400201 TCLIBC: [glibc, musl]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500202 TS: [none, qemuarm64-secureboot-ts]
Patrick Williams92b42cb2022-09-03 06:53:57 -0500203 TESTING: testimage
Patrick Williams03514f12024-04-05 07:04:11 -0500204 - KERNEL: linux-yocto-dev
205 TESTING: testimage
Patrick Williams92b42cb2022-09-03 06:53:57 -0500206
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400207qemuarm64:
208 extends: .build
209 parallel:
210 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500211 - DISTRO: poky
Patrick Williams03514f12024-04-05 07:04:11 -0500212 KERNEL: [linux-yocto, linux-yocto-rt]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500213 TOOLCHAINS: [gcc, clang]
214 FIRMWARE: [u-boot, edk2]
215 TESTING: testimage
216 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400217 TESTING: testimage
218 - VIRT: xen
Patrick Williams03514f12024-04-05 07:04:11 -0500219 - KERNEL: linux-yocto-dev
220 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400221
222qemuarm-secureboot:
223 extends: .build
224 parallel:
225 matrix:
Patrick Williams03514f12024-04-05 07:04:11 -0500226 - KERNEL: [linux-yocto, linux-yocto-rt]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500227 TOOLCHAINS: [gcc, clang]
228 TCLIBC: [glibc, musl]
229 TESTING: testimage
230 - TOOLCHAINS: external-gccarm
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400231 TESTING: testimage
Patrick Williams03514f12024-04-05 07:04:11 -0500232 - KERNEL: linux-yocto-dev
233 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400234
235qemuarm:
236 extends: .build
237 parallel:
238 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500239 - DISTRO: poky
Patrick Williams03514f12024-04-05 07:04:11 -0500240 KERNEL: [linux-yocto, linux-yocto-rt]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500241 TOOLCHAINS: [gcc, clang]
242 FIRMWARE: [u-boot, edk2]
243 TESTING: testimage
244 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400245 TESTING: testimage
246 - VIRT: xen
Patrick Williams03514f12024-04-05 07:04:11 -0500247 - KERNEL: linux-yocto-dev
248 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400249
250qemuarmv5:
251 extends: .build
252 parallel:
253 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500254 - DISTRO: poky
255 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
256 TESTING: testimage
257 - DISTRO: poky-tiny
258 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400259
260sgi575:
261 extends: .build
262
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400263toolchains:
264 extends: .build
265
266selftest:
267 extends: .setup
268 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500269 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600270 - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 2 --select-tag meta-arm --run-all-tests'
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400271
272# Validate layers are Yocto Project Compatible
273check-layers:
274 extends: .setup
275 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500276 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400277 "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
278 parallel:
279 matrix:
Andrew Geissler517393d2023-01-13 08:55:19 -0600280 - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400281
282pending-updates:
283 extends: .setup
284 artifacts:
285 paths:
286 - update-report
287 script:
288 - rm -fr update-report
289 # This configuration has all of the layers we need enabled
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600290 - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/meta-secure-core.yml:lockfile.yml --command \
Andrew Geissler517393d2023-01-13 08:55:19 -0600291 "$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 -0400292 # Do this on x86 whilst the compilers are x86-only
293 tags:
294 - x86_64
295
296# What percentage of machines in the layer do we build
297machine-coverage:
Andrew Geissler517393d2023-01-13 08:55:19 -0600298 extends: .setup
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400299 script:
300 - ./ci/check-machine-coverage
301 coverage: '/Coverage: \d+/'
302
303metrics:
304 extends: .setup
305 artifacts:
306 reports:
307 metrics: metrics.txt
308 script:
309 - kas shell --update --force-checkout ci/base.yml --command \
310 "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500311
312documentation:
313 extends: .setup
314 script:
315 - |
Andrew Geissler220dafd2023-10-04 10:18:08 -0500316 # This can be removed when the kas container has python3-venv installed
317 sudo apt-get update && sudo apt-get install --yes python3-venv
318
319 python3 -m venv venv
320 . ./venv/bin/activate
321
322 pip3 install -r meta-arm-bsp/documentation/requirements.txt
323
Patrick Williams2390b1b2022-11-03 13:47:49 -0500324 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500325 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500326 SOURCE_DIR=$(dirname $CONF)
327 MACHINE=$(basename $SOURCE_DIR)
328 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
329 done
330 test -d build-docs/
331 artifacts:
332 paths:
333 - build-docs/