blob: 22ecfd713a6c9210606bd2da609619ae517c5bcd [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
Patrick Williams169d7bc2024-01-05 11:33:25 -060012 ACS_TEST: 0
13 ACS_TAG: ""
Andrew Geissler517393d2023-01-13 08:55:19 -060014
Brad Bishopbec4ebc2022-08-03 09:55:16 -040015stages:
16 - prep
17 - build
18
19# Common job fragment to get a worker ready
20.setup:
Andrew Geissler517393d2023-01-13 08:55:19 -060021 tags:
22 - $DEFAULT_TAG
Brad Bishopbec4ebc2022-08-03 09:55:16 -040023 stage: build
24 interruptible: true
25 variables:
26 KAS_WORK_DIR: $CI_PROJECT_DIR/work
Andrew Geissler9347dd42023-03-03 12:38:41 -060027 KAS_REPO_REF_DIR: $CACHE_DIR/repos
28 SSTATE_DIR: $CACHE_DIR/sstate
29 DL_DIR: $CACHE_DIR/downloads
Brad Bishopbec4ebc2022-08-03 09:55:16 -040030 BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
Andrew Geissler9347dd42023-03-03 12:38:41 -060031 TOOLCHAIN_DIR: $CACHE_DIR/toolchains
Brad Bishopbec4ebc2022-08-03 09:55:16 -040032 IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
33 TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
34 before_script:
35 - echo KAS_WORK_DIR = $KAS_WORK_DIR
36 - echo SSTATE_DIR = $SSTATE_DIR
37 - echo DL_DIR = $DL_DIR
38 - rm -rf $KAS_WORK_DIR
39 - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
40 # Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
41 - ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
Brad Bishopbec4ebc2022-08-03 09:55:16 -040042
43# Generalised fragment to do a Kas build
44.build:
45 extends: .setup
Andrew Geissler517393d2023-01-13 08:55:19 -060046 variables:
47 KUBERNETES_CPU_REQUEST: $CPU_REQUEST
Patrick Williams8e7b46e2023-05-01 14:19:06 -050048 rules:
49 # Don't run MR pipelines
50 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
51 when: never
52 # Don't run pipelines for tags
53 - if: $CI_COMMIT_TAG
54 when: never
55 # Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
56 - if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
57 when: never
58 # Allow the dev kernels to fail and not fail the overall build
59 - if: '$KERNEL == "linux-yocto-dev"'
60 allow_failure: true
61 # Catch all for everything else
62 - if: '$KERNEL != "linux-yocto-dev"'
Brad Bishopbec4ebc2022-08-03 09:55:16 -040063 script:
Andrew Geissler23e02792023-07-21 09:06:10 -050064 - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME"):lockfile.yml
65 - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
Brad Bishopbec4ebc2022-08-03 09:55:16 -040066 - kas build $KASFILES
67 - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
68 artifacts:
69 name: "logs"
Patrick Williams520786c2023-06-25 16:20:36 -050070 when: always
Brad Bishopbec4ebc2022-08-03 09:55:16 -040071 paths:
Patrick Williams169d7bc2024-01-05 11:33:25 -060072 - $CI_PROJECT_DIR/work/build/tmp*/work*/**/temp/log.do_*.*
73 - $CI_PROJECT_DIR/work/build/tmp*/work*/**/testimage/*
Brad Bishopbec4ebc2022-08-03 09:55:16 -040074
75#
Andrew Geissler2daf84b2023-03-31 09:57:23 -050076# Prep stage, update repositories once.
77# Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch
Brad Bishopbec4ebc2022-08-03 09:55:16 -040078#
79update-repos:
80 extends: .setup
81 stage: prep
Andrew Geissler220dafd2023-10-04 10:18:08 -050082 allow_failure:
83 exit_codes: 128
Brad Bishopbec4ebc2022-08-03 09:55:16 -040084 script:
Andrew Geissler23e02792023-07-21 09:06:10 -050085 - |
86 flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
87 # Only generate if doesn't already exist, to allow feature branches to drop one in.
88 if test -f lockfile.yml; then
89 echo Using existing lockfile.yml
90 else
91 # Be sure that this is the complete list of layers being fetched
92 kas dump --lock --update ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/clang.yml:ci/meta-virtualization.yml | tee lockfile.yml
93 fi
94 artifacts:
95 name: "lockfile"
96 paths:
97 - lockfile.yml
Brad Bishopbec4ebc2022-08-03 09:55:16 -040098
99#
100# Build stage, the actual build jobs
101#
102# Available options for building are
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500103# DISTRO: [poky, poky-tiny]
104# KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williams520786c2023-06-25 16:20:36 -0500105# TOOLCHAINS: [gcc, clang, external-gccarm]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400106# TCLIBC: [glibc, musl]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500107# FIRMWARE: [u-boot, edk2]
108# TS: [none, trusted-services]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400109# VIRT: [none, xen]
110# TESTING: testimage
111
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400112corstone1000-fvp:
113 extends: .build
114 parallel:
115 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500116 - TESTING: [testimage, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400117
118corstone1000-mps3:
119 extends: .build
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600120 parallel:
121 matrix:
122 - TESTING: [none, tftf]
123
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400124
125fvp-base:
126 extends: .build
127 parallel:
128 matrix:
129 - TESTING: testimage
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500130 - FIRMWARE: edk2
Patrick Williams169d7bc2024-01-05 11:33:25 -0600131 - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
132
133arm-systemready-ir-acs:
134 extends: .build
135 timeout: 12h
136 parallel:
137 matrix:
138 # arm-systemready-ir-acs must be specified after fvp-base for ordering
139 # purposes for the jobs-to-kas output. It is not enough to just have it
140 # in the job name because fvp-base.yml overwrites the target.
141 - PLATFORM: fvp-base
142 ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
143 tags:
144 - ${ACS_TAG}
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400145
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400146fvps:
147 extends: .build
148
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400149generic-arm64:
150 extends: .build
151
152juno:
153 extends: .build
154 parallel:
155 matrix:
156 - TOOLCHAINS: [gcc, clang]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500157 FIRMWARE: [u-boot, edk2]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400158
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400159musca-b1:
160 extends: .build
161
162musca-s1:
163 extends: .build
164
165n1sdp:
166 extends: .build
167 parallel:
168 matrix:
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600169 - TESTING: [none, n1sdp-ts, n1sdp-optee, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400170
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400171qemu-generic-arm64:
172 extends: .build
173 parallel:
174 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500175 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
176 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400177 TESTING: testimage
178
179qemuarm64-secureboot:
180 extends: .build
181 parallel:
182 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500183 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
184 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400185 TCLIBC: [glibc, musl]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500186 TS: [none, qemuarm64-secureboot-ts]
Patrick Williams92b42cb2022-09-03 06:53:57 -0500187 TESTING: testimage
188
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400189qemuarm64:
190 extends: .build
191 parallel:
192 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500193 - DISTRO: poky
194 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
195 TOOLCHAINS: [gcc, clang]
196 FIRMWARE: [u-boot, edk2]
197 TESTING: testimage
198 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400199 TESTING: testimage
200 - VIRT: xen
201
202qemuarm-secureboot:
203 extends: .build
204 parallel:
205 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500206 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500207 TOOLCHAINS: [gcc, clang]
208 TCLIBC: [glibc, musl]
209 TESTING: testimage
210 - TOOLCHAINS: external-gccarm
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400211 TESTING: testimage
212
213qemuarm:
214 extends: .build
215 parallel:
216 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500217 - DISTRO: poky
218 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
219 TOOLCHAINS: [gcc, clang]
220 FIRMWARE: [u-boot, edk2]
221 TESTING: testimage
222 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400223 TESTING: testimage
224 - VIRT: xen
225
226qemuarmv5:
227 extends: .build
228 parallel:
229 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500230 - DISTRO: poky
231 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
232 TESTING: testimage
233 - DISTRO: poky-tiny
234 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400235
236sgi575:
237 extends: .build
238
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400239tc1:
240 extends: .build
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500241 parallel:
242 matrix:
243 - TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400244 tags:
245 - x86_64
246
247toolchains:
248 extends: .build
249
250selftest:
251 extends: .setup
252 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500253 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600254 - 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 -0400255
256# Validate layers are Yocto Project Compatible
257check-layers:
258 extends: .setup
259 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500260 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400261 "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
262 parallel:
263 matrix:
Andrew Geissler517393d2023-01-13 08:55:19 -0600264 - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400265
266pending-updates:
267 extends: .setup
268 artifacts:
269 paths:
270 - update-report
271 script:
272 - rm -fr update-report
273 # This configuration has all of the layers we need enabled
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600274 - 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 -0600275 "$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 -0400276 # Do this on x86 whilst the compilers are x86-only
277 tags:
278 - x86_64
279
280# What percentage of machines in the layer do we build
281machine-coverage:
Andrew Geissler517393d2023-01-13 08:55:19 -0600282 extends: .setup
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400283 script:
284 - ./ci/check-machine-coverage
285 coverage: '/Coverage: \d+/'
286
287metrics:
288 extends: .setup
289 artifacts:
290 reports:
291 metrics: metrics.txt
292 script:
293 - kas shell --update --force-checkout ci/base.yml --command \
294 "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500295
296documentation:
297 extends: .setup
298 script:
299 - |
Andrew Geissler220dafd2023-10-04 10:18:08 -0500300 # This can be removed when the kas container has python3-venv installed
301 sudo apt-get update && sudo apt-get install --yes python3-venv
302
303 python3 -m venv venv
304 . ./venv/bin/activate
305
306 pip3 install -r meta-arm-bsp/documentation/requirements.txt
307
Patrick Williams2390b1b2022-11-03 13:47:49 -0500308 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500309 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500310 SOURCE_DIR=$(dirname $CONF)
311 MACHINE=$(basename $SOURCE_DIR)
312 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
313 done
314 test -d build-docs/
315 artifacts:
316 paths:
317 - build-docs/