blob: 4a786f633b07d424fdb062606c0d37fea6827d2b [file] [log] [blame]
Andrew Geissler23e02792023-07-21 09:06:10 -05001image: ghcr.io/siemens/kas/kas:3.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:
Andrew Geissler23e02792023-07-21 09:06:10 -050061 - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME"):lockfile.yml
62 - 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:
Andrew Geissler23e02792023-07-21 09:06:10 -050080 - |
81 flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
82 # Only generate if doesn't already exist, to allow feature branches to drop one in.
83 if test -f lockfile.yml; then
84 echo Using existing lockfile.yml
85 else
86 # Be sure that this is the complete list of layers being fetched
87 kas dump --lock --update ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/clang.yml:ci/meta-virtualization.yml | tee lockfile.yml
88 fi
89 artifacts:
90 name: "lockfile"
91 paths:
92 - lockfile.yml
Brad Bishopbec4ebc2022-08-03 09:55:16 -040093
94#
95# Build stage, the actual build jobs
96#
97# Available options for building are
Andrew Geissler2daf84b2023-03-31 09:57:23 -050098# DISTRO: [poky, poky-tiny]
99# KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williams520786c2023-06-25 16:20:36 -0500100# TOOLCHAINS: [gcc, clang, external-gccarm]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400101# TCLIBC: [glibc, musl]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500102# FIRMWARE: [u-boot, edk2]
103# TS: [none, trusted-services]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400104# VIRT: [none, xen]
105# TESTING: testimage
106
107corstone500:
108 extends: .build
109 parallel:
110 matrix:
111 - TESTING: testimage
112 tags:
113 - x86_64
114
115corstone1000-fvp:
116 extends: .build
117 parallel:
118 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500119 - TESTING: [testimage, tftf]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400120 tags:
121 - x86_64
122
123corstone1000-mps3:
124 extends: .build
125
126fvp-base:
127 extends: .build
128 parallel:
129 matrix:
130 - TESTING: testimage
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500131 - FIRMWARE: edk2
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400132
133fvp-baser-aemv8r64:
134 extends: .build
135 parallel:
136 matrix:
137 - TESTING: testimage
138 tags:
139 - x86_64
140
141fvps:
142 extends: .build
143
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400144generic-arm64:
145 extends: .build
146
147juno:
148 extends: .build
149 parallel:
150 matrix:
151 - TOOLCHAINS: [gcc, clang]
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500152 FIRMWARE: [u-boot, edk2]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400153
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400154musca-b1:
155 extends: .build
156
157musca-s1:
158 extends: .build
159
160n1sdp:
161 extends: .build
162 parallel:
163 matrix:
Patrick Williams520786c2023-06-25 16:20:36 -0500164 - TS: [none, n1sdp-ts]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400165
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400166qemu-generic-arm64:
167 extends: .build
168 parallel:
169 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500170 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
171 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400172 TESTING: testimage
173
174qemuarm64-secureboot:
175 extends: .build
176 parallel:
177 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500178 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
179 TOOLCHAINS: [gcc, clang]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400180 TCLIBC: [glibc, musl]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500181 TS: [none, qemuarm64-secureboot-ts]
Patrick Williams92b42cb2022-09-03 06:53:57 -0500182 TESTING: testimage
183
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400184qemuarm64:
185 extends: .build
186 parallel:
187 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500188 - DISTRO: poky
189 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
190 TOOLCHAINS: [gcc, clang]
191 FIRMWARE: [u-boot, edk2]
192 TESTING: testimage
193 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400194 TESTING: testimage
195 - VIRT: xen
196
197qemuarm-secureboot:
198 extends: .build
199 parallel:
200 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500201 - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
Patrick Williamsb542dec2023-06-09 01:26:37 -0500202 TOOLCHAINS: [gcc, clang]
203 TCLIBC: [glibc, musl]
204 TESTING: testimage
205 - TOOLCHAINS: external-gccarm
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400206 TESTING: testimage
207
208qemuarm:
209 extends: .build
210 parallel:
211 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500212 - DISTRO: poky
213 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
214 TOOLCHAINS: [gcc, clang]
215 FIRMWARE: [u-boot, edk2]
216 TESTING: testimage
217 - DISTRO: poky-tiny
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400218 TESTING: testimage
219 - VIRT: xen
220
221qemuarmv5:
222 extends: .build
223 parallel:
224 matrix:
Andrew Geissler2daf84b2023-03-31 09:57:23 -0500225 - DISTRO: poky
226 KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
227 TESTING: testimage
228 - DISTRO: poky-tiny
229 TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400230
231sgi575:
232 extends: .build
233
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400234tc1:
235 extends: .build
Patrick Williams8e7b46e2023-05-01 14:19:06 -0500236 parallel:
237 matrix:
238 - TESTING: testimage
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400239 tags:
240 - x86_64
241
242toolchains:
243 extends: .build
244
245selftest:
246 extends: .setup
247 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500248 - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400249 - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 1 --run-tests runfvp'
250
251# Validate layers are Yocto Project Compatible
252check-layers:
253 extends: .setup
254 script:
Andrew Geissler23e02792023-07-21 09:06:10 -0500255 - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400256 "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
257 parallel:
258 matrix:
Andrew Geissler517393d2023-01-13 08:55:19 -0600259 - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400260
261pending-updates:
262 extends: .setup
263 artifacts:
264 paths:
265 - update-report
266 script:
267 - rm -fr update-report
268 # This configuration has all of the layers we need enabled
Andrew Geissler23e02792023-07-21 09:06:10 -0500269 - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:lockfile.yml --command \
Andrew Geissler517393d2023-01-13 08:55:19 -0600270 "$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 -0400271 # Do this on x86 whilst the compilers are x86-only
272 tags:
273 - x86_64
274
275# What percentage of machines in the layer do we build
276machine-coverage:
Andrew Geissler517393d2023-01-13 08:55:19 -0600277 extends: .setup
Brad Bishopbec4ebc2022-08-03 09:55:16 -0400278 script:
279 - ./ci/check-machine-coverage
280 coverage: '/Coverage: \d+/'
281
282metrics:
283 extends: .setup
284 artifacts:
285 reports:
286 metrics: metrics.txt
287 script:
288 - kas shell --update --force-checkout ci/base.yml --command \
289 "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
Patrick Williams2390b1b2022-11-03 13:47:49 -0500290
291documentation:
292 extends: .setup
293 script:
294 - |
295 sudo pip3 install -r meta-arm-bsp/documentation/requirements.txt
296 for CONF in meta-*/documentation/*/conf.py ; do
Patrick Williams520786c2023-06-25 16:20:36 -0500297 echo Building $CONF...
Patrick Williams2390b1b2022-11-03 13:47:49 -0500298 SOURCE_DIR=$(dirname $CONF)
299 MACHINE=$(basename $SOURCE_DIR)
300 sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
301 done
302 test -d build-docs/
303 artifacts:
304 paths:
305 - build-docs/