blob: b2246743f747d13401d02f0954544ceb0cbd2d84 [file] [log] [blame]
Patrick Williams8e7b46e2023-05-01 14:19:06 -05001image: ghcr.io/siemens/kas/kas:3.2.3
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 Geissler517393d2023-01-13 08:55:19 -06007 # These are needed as the k8s executor doesn't respect the container entrypoint
8 # by default
9 FF_KUBERNETES_HONOR_ENTRYPOINT: 1
10 FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
11
Brad Bishopbec4ebc2022-08-03 09:55:16 -040012stages:
13 - prep
14 - build
15
16# Common job fragment to get a worker ready
17.setup:
Andrew Geissler517393d2023-01-13 08:55:19 -060018 tags:
19 - $DEFAULT_TAG
Brad Bishopbec4ebc2022-08-03 09:55:16 -040020 stage: build
21 interruptible: true
22 variables:
23 KAS_WORK_DIR: $CI_PROJECT_DIR/work
Andrew Geissler9347dd42023-03-03 12:38:41 -060024 KAS_REPO_REF_DIR: $CACHE_DIR/repos
25 SSTATE_DIR: $CACHE_DIR/sstate
26 DL_DIR: $CACHE_DIR/downloads
Brad Bishopbec4ebc2022-08-03 09:55:16 -040027 BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
Andrew Geissler9347dd42023-03-03 12:38:41 -060028 TOOLCHAIN_DIR: $CACHE_DIR/toolchains
Brad Bishopbec4ebc2022-08-03 09:55:16 -040029 IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
30 TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
31 before_script:
32 - echo KAS_WORK_DIR = $KAS_WORK_DIR
33 - echo SSTATE_DIR = $SSTATE_DIR
34 - echo DL_DIR = $DL_DIR
35 - rm -rf $KAS_WORK_DIR
36 - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
37 # Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
38 - ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
Brad Bishopbec4ebc2022-08-03 09:55:16 -040039
40# Generalised fragment to do a Kas build
41.build:
42 extends: .setup
Andrew Geissler517393d2023-01-13 08:55:19 -060043 variables:
44 KUBERNETES_CPU_REQUEST: $CPU_REQUEST
Patrick Williams8e7b46e2023-05-01 14:19:06 -050045 rules:
46 # Don't run MR pipelines
47 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
48 when: never
49 # Don't run pipelines for tags
50 - if: $CI_COMMIT_TAG
51 when: never
52 # Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
53 - if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
54 when: never
55 # Allow the dev kernels to fail and not fail the overall build
56 - if: '$KERNEL == "linux-yocto-dev"'
57 allow_failure: true
58 # Catch all for everything else
59 - if: '$KERNEL != "linux-yocto-dev"'
Brad Bishopbec4ebc2022-08-03 09:55:16 -040060 script:
61 - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME")
Andrew Geisslerea144b02023-01-27 16:03:57 -060062 - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
Brad Bishopbec4ebc2022-08-03 09:55:16 -040063 - kas build $KASFILES
64 - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
65 artifacts:
66 name: "logs"
Patrick Williams520786c2023-06-25 16:20:36 -050067 when: always
Brad Bishopbec4ebc2022-08-03 09:55:16 -040068 paths:
69 - $CI_PROJECT_DIR/work/build/tmp/work*/**/temp/log.do_*.*
Andrew Geissler9347dd42023-03-03 12:38:41 -060070 - $CI_PROJECT_DIR/work/build/tmp/work*/**/testimage/*
Brad Bishopbec4ebc2022-08-03 09:55:16 -040071
72#
Andrew Geissler2daf84b2023-03-31 09:57:23 -050073# Prep stage, update repositories once.
74# Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch
Brad Bishopbec4ebc2022-08-03 09:55:16 -040075#
76update-repos:
77 extends: .setup
78 stage: prep
79 script:
80 - flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
81
82#
83# Build stage, the actual build jobs
84#
85# Available options for building are
Andrew Geissler2daf84b2023-03-31 09:57:23 -050086# DISTRO: [poky, poky-tiny]
87# KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williams520786c2023-06-25 16:20:36 -050088# TOOLCHAINS: [gcc, clang, external-gccarm]
Brad Bishopbec4ebc2022-08-03 09:55:16 -040089# TCLIBC: [glibc, musl]
Andrew Geissler2daf84b2023-03-31 09:57:23 -050090# FIRMWARE: [u-boot, edk2]
91# TS: [none, trusted-services]
Brad Bishopbec4ebc2022-08-03 09:55:16 -040092# VIRT: [none, xen]
93# TESTING: testimage
94
95corstone500:
96 extends: .build
97 parallel:
98 matrix:
99 - TESTING: testimage
100 tags:
101 - x86_64
102
103corstone1000-fvp:
104 extends: .build
105 parallel:
106 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500107 - TESTING: [testimage, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400108 tags:
109 - x86_64
110
111corstone1000-mps3:
112 extends: .build
113
114fvp-base:
115 extends: .build
116 parallel:
117 matrix:
118 - TESTING: testimage
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500119 - FIRMWARE: edk2
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400120
121fvp-baser-aemv8r64:
122 extends: .build
123 parallel:
124 matrix:
125 - TESTING: testimage
126 tags:
127 - x86_64
128
129fvps:
130 extends: .build
131
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400132generic-arm64:
133 extends: .build
134
135juno:
136 extends: .build
137 parallel:
138 matrix:
139 - TOOLCHAINS: [gcc, clang]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500140 FIRMWARE: [u-boot, edk2]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400141
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400142musca-b1:
143 extends: .build
144
145musca-s1:
146 extends: .build
147
148n1sdp:
149 extends: .build
150 parallel:
151 matrix:
Patrick Williams520786c2023-06-25 16:20:36 -0500152 - TS: [none, n1sdp-ts]
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:
236 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml
237 - 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:
243 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml --command \
244 "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 Geisslerea144b02023-01-27 16:03:57 -0600257 - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.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 - |
283 sudo pip3 install -r meta-arm-bsp/documentation/requirements.txt
284 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500285 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500286 SOURCE_DIR=$(dirname $CONF)
287 MACHINE=$(basename $SOURCE_DIR)
288 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
289 done
290 test -d build-docs/
291 artifacts:
292 paths:
293 - build-docs/