blob: 15cf4ecdbb7918f524096fb619c4031bf560f3ec [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:
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:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500189 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
190 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400191 TESTING: testimage
192
193qemuarm64-secureboot:
194 extends: .build
195 parallel:
196 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500197 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
198 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400199 TCLIBC: [glibc, musl]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500200 TS: [none, qemuarm64-secureboot-ts]
Patrick Williams92b42cb2022-09-03 06:53:57 -0500201 TESTING: testimage
202
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400203qemuarm64:
204 extends: .build
205 parallel:
206 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500207 - DISTRO: poky
208 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
209 TOOLCHAINS: [gcc, clang]
210 FIRMWARE: [u-boot, edk2]
211 TESTING: testimage
212 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400213 TESTING: testimage
214 - VIRT: xen
215
216qemuarm-secureboot:
217 extends: .build
218 parallel:
219 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500220 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500221 TOOLCHAINS: [gcc, clang]
222 TCLIBC: [glibc, musl]
223 TESTING: testimage
224 - TOOLCHAINS: external-gccarm
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400225 TESTING: testimage
226
227qemuarm:
228 extends: .build
229 parallel:
230 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500231 - DISTRO: poky
232 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
233 TOOLCHAINS: [gcc, clang]
234 FIRMWARE: [u-boot, edk2]
235 TESTING: testimage
236 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400237 TESTING: testimage
238 - VIRT: xen
239
240qemuarmv5:
241 extends: .build
242 parallel:
243 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500244 - DISTRO: poky
245 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
246 TESTING: testimage
247 - DISTRO: poky-tiny
248 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400249
250sgi575:
251 extends: .build
252
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400253tc1:
254 extends: .build
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500255 parallel:
256 matrix:
257 - TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400258 tags:
259 - x86_64
260
261toolchains:
262 extends: .build
263
264selftest:
265 extends: .setup
266 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500267 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600268 - 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 -0400269
270# Validate layers are Yocto Project Compatible
271check-layers:
272 extends: .setup
273 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500274 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400275 "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
276 parallel:
277 matrix:
Andrew Geissler517393d2023-01-13 08:55:19 -0600278 - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400279
280pending-updates:
281 extends: .setup
282 artifacts:
283 paths:
284 - update-report
285 script:
286 - rm -fr update-report
287 # This configuration has all of the layers we need enabled
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600288 - 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 -0600289 "$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 -0400290 # Do this on x86 whilst the compilers are x86-only
291 tags:
292 - x86_64
293
294# What percentage of machines in the layer do we build
295machine-coverage:
Andrew Geissler517393d2023-01-13 08:55:19 -0600296 extends: .setup
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400297 script:
298 - ./ci/check-machine-coverage
299 coverage: '/Coverage: \d+/'
300
301metrics:
302 extends: .setup
303 artifacts:
304 reports:
305 metrics: metrics.txt
306 script:
307 - kas shell --update --force-checkout ci/base.yml --command \
308 "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500309
310documentation:
311 extends: .setup
312 script:
313 - |
Andrew Geissler220dafd2023-10-04 10:18:08 -0500314 # This can be removed when the kas container has python3-venv installed
315 sudo apt-get update && sudo apt-get install --yes python3-venv
316
317 python3 -m venv venv
318 . ./venv/bin/activate
319
320 pip3 install -r meta-arm-bsp/documentation/requirements.txt
321
Patrick Williams2390b1b2022-11-03 13:47:49 -0500322 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500323 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500324 SOURCE_DIR=$(dirname $CONF)
325 MACHINE=$(basename $SOURCE_DIR)
326 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
327 done
328 test -d build-docs/
329 artifacts:
330 paths:
331 - build-docs/