blob: 9dee5807053e74ed744f3c0c30531b50335a3a99 [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
116corstone1000-mps3:
117 extends: .build
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600118 parallel:
119 matrix:
120 - TESTING: [none, tftf]
121
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400122
123fvp-base:
124 extends: .build
125 parallel:
126 matrix:
127 - TESTING: testimage
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500128 - FIRMWARE: edk2
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400129
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400130fvps:
131 extends: .build
132
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400133generic-arm64:
134 extends: .build
135
136juno:
137 extends: .build
138 parallel:
139 matrix:
140 - TOOLCHAINS: [gcc, clang]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500141 FIRMWARE: [u-boot, edk2]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400142
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400143musca-b1:
144 extends: .build
145
146musca-s1:
147 extends: .build
148
149n1sdp:
150 extends: .build
151 parallel:
152 matrix:
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600153 - TESTING: [none, n1sdp-ts, n1sdp-optee, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400154
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400155qemu-generic-arm64:
156 extends: .build
157 parallel:
158 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500159 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
160 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400161 TESTING: testimage
162
163qemuarm64-secureboot:
164 extends: .build
165 parallel:
166 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500167 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
168 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400169 TCLIBC: [glibc, musl]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500170 TS: [none, qemuarm64-secureboot-ts]
Patrick Williams92b42cb2022-09-03 06:53:57 -0500171 TESTING: testimage
172
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400173qemuarm64:
174 extends: .build
175 parallel:
176 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500177 - DISTRO: poky
178 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
179 TOOLCHAINS: [gcc, clang]
180 FIRMWARE: [u-boot, edk2]
181 TESTING: testimage
182 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400183 TESTING: testimage
184 - VIRT: xen
185
186qemuarm-secureboot:
187 extends: .build
188 parallel:
189 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500190 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500191 TOOLCHAINS: [gcc, clang]
192 TCLIBC: [glibc, musl]
193 TESTING: testimage
194 - TOOLCHAINS: external-gccarm
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400195 TESTING: testimage
196
197qemuarm:
198 extends: .build
199 parallel:
200 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500201 - DISTRO: poky
202 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
203 TOOLCHAINS: [gcc, clang]
204 FIRMWARE: [u-boot, edk2]
205 TESTING: testimage
206 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400207 TESTING: testimage
208 - VIRT: xen
209
210qemuarmv5:
211 extends: .build
212 parallel:
213 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500214 - DISTRO: poky
215 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
216 TESTING: testimage
217 - DISTRO: poky-tiny
218 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400219
220sgi575:
221 extends: .build
222
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400223tc1:
224 extends: .build
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500225 parallel:
226 matrix:
227 - TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400228 tags:
229 - x86_64
230
231toolchains:
232 extends: .build
233
234selftest:
235 extends: .setup
236 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500237 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600238 - 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 -0400239
240# Validate layers are Yocto Project Compatible
241check-layers:
242 extends: .setup
243 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500244 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400245 "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
246 parallel:
247 matrix:
Andrew Geissler517393d2023-01-13 08:55:19 -0600248 - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400249
250pending-updates:
251 extends: .setup
252 artifacts:
253 paths:
254 - update-report
255 script:
256 - rm -fr update-report
257 # This configuration has all of the layers we need enabled
Patrick Williamsac13d5f2023-11-24 18:59:46 -0600258 - 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 -0600259 "$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 -0400260 # Do this on x86 whilst the compilers are x86-only
261 tags:
262 - x86_64
263
264# What percentage of machines in the layer do we build
265machine-coverage:
Andrew Geissler517393d2023-01-13 08:55:19 -0600266 extends: .setup
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400267 script:
268 - ./ci/check-machine-coverage
269 coverage: '/Coverage: \d+/'
270
271metrics:
272 extends: .setup
273 artifacts:
274 reports:
275 metrics: metrics.txt
276 script:
277 - kas shell --update --force-checkout ci/base.yml --command \
278 "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500279
280documentation:
281 extends: .setup
282 script:
283 - |
Andrew Geissler220dafd2023-10-04 10:18:08 -0500284 # This can be removed when the kas container has python3-venv installed
285 sudo apt-get update && sudo apt-get install --yes python3-venv
286
287 python3 -m venv venv
288 . ./venv/bin/activate
289
290 pip3 install -r meta-arm-bsp/documentation/requirements.txt
291
Patrick Williams2390b1b2022-11-03 13:47:49 -0500292 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500293 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500294 SOURCE_DIR=$(dirname $CONF)
295 MACHINE=$(basename $SOURCE_DIR)
296 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
297 done
298 test -d build-docs/
299 artifacts:
300 paths:
301 - build-docs/