Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 1 | image: ${MIRROR_GHCR}/siemens/kas/kas:4.0 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 2 | |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 3 | variables: |
| 4 | CPU_REQUEST: "" |
| 5 | DEFAULT_TAG: "" |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 6 | CACHE_DIR: $CI_BUILDS_DIR/persist |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 7 | MIRROR_GHCR: ghcr.io |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 8 | # 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 Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 12 | ACS_TEST: 0 |
| 13 | ACS_TAG: "" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 14 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 15 | stages: |
| 16 | - prep |
| 17 | - build |
| 18 | |
| 19 | # Common job fragment to get a worker ready |
| 20 | .setup: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 21 | tags: |
| 22 | - $DEFAULT_TAG |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 23 | stage: build |
| 24 | interruptible: true |
| 25 | variables: |
| 26 | KAS_WORK_DIR: $CI_PROJECT_DIR/work |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 27 | KAS_REPO_REF_DIR: $CACHE_DIR/repos |
| 28 | SSTATE_DIR: $CACHE_DIR/sstate |
| 29 | DL_DIR: $CACHE_DIR/downloads |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 30 | BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 31 | TOOLCHAIN_DIR: $CACHE_DIR/toolchains |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 32 | 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 42 | |
| 43 | # Generalised fragment to do a Kas build |
| 44 | .build: |
| 45 | extends: .setup |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 46 | variables: |
| 47 | KUBERNETES_CPU_REQUEST: $CPU_REQUEST |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 48 | 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 63 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 64 | - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME"):lockfile.yml |
| 65 | - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 66 | - kas build $KASFILES |
| 67 | - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log |
| 68 | artifacts: |
| 69 | name: "logs" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 70 | when: always |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 71 | paths: |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 72 | - $CI_PROJECT_DIR/work/build/tmp*/work*/**/temp/log.do_*.* |
| 73 | - $CI_PROJECT_DIR/work/build/tmp*/work*/**/testimage/* |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 74 | |
| 75 | # |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 76 | # Prep stage, update repositories once. |
| 77 | # Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 78 | # |
| 79 | update-repos: |
| 80 | extends: .setup |
| 81 | stage: prep |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 82 | allow_failure: |
| 83 | exit_codes: 128 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 84 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 85 | - | |
| 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 98 | |
| 99 | # |
| 100 | # Build stage, the actual build jobs |
| 101 | # |
| 102 | # Available options for building are |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 103 | # DISTRO: [poky, poky-tiny] |
| 104 | # KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 105 | # TOOLCHAINS: [gcc, clang, external-gccarm] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 106 | # TCLIBC: [glibc, musl] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 107 | # FIRMWARE: [u-boot, edk2] |
| 108 | # TS: [none, trusted-services] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 109 | # VIRT: [none, xen] |
| 110 | # TESTING: testimage |
| 111 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 112 | corstone1000-fvp: |
| 113 | extends: .build |
| 114 | parallel: |
| 115 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 116 | - TESTING: [testimage, tftf] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 117 | |
| 118 | corstone1000-mps3: |
| 119 | extends: .build |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 120 | parallel: |
| 121 | matrix: |
| 122 | - TESTING: [none, tftf] |
| 123 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 124 | |
| 125 | fvp-base: |
| 126 | extends: .build |
| 127 | parallel: |
| 128 | matrix: |
| 129 | - TESTING: testimage |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 130 | - FIRMWARE: edk2 |
Patrick Williams | 169d7bc | 2024-01-05 11:33:25 -0600 | [diff] [blame] | 131 | - SYSTEMREADY_FIRMWARE: arm-systemready-firmware |
| 132 | |
| 133 | arm-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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 145 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 146 | fvps: |
| 147 | extends: .build |
| 148 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 149 | generic-arm64: |
| 150 | extends: .build |
| 151 | |
| 152 | juno: |
| 153 | extends: .build |
| 154 | parallel: |
| 155 | matrix: |
| 156 | - TOOLCHAINS: [gcc, clang] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 157 | FIRMWARE: [u-boot, edk2] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 158 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 159 | musca-b1: |
| 160 | extends: .build |
| 161 | |
| 162 | musca-s1: |
| 163 | extends: .build |
| 164 | |
| 165 | n1sdp: |
| 166 | extends: .build |
| 167 | parallel: |
| 168 | matrix: |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 169 | - TESTING: [none, n1sdp-ts, n1sdp-optee, tftf] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 170 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 171 | qemu-generic-arm64: |
| 172 | extends: .build |
| 173 | parallel: |
| 174 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 175 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 176 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 177 | TESTING: testimage |
| 178 | |
| 179 | qemuarm64-secureboot: |
| 180 | extends: .build |
| 181 | parallel: |
| 182 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 183 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 184 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 185 | TCLIBC: [glibc, musl] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 186 | TS: [none, qemuarm64-secureboot-ts] |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 187 | TESTING: testimage |
| 188 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 189 | qemuarm64: |
| 190 | extends: .build |
| 191 | parallel: |
| 192 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 193 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 199 | TESTING: testimage |
| 200 | - VIRT: xen |
| 201 | |
| 202 | qemuarm-secureboot: |
| 203 | extends: .build |
| 204 | parallel: |
| 205 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 206 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 207 | TOOLCHAINS: [gcc, clang] |
| 208 | TCLIBC: [glibc, musl] |
| 209 | TESTING: testimage |
| 210 | - TOOLCHAINS: external-gccarm |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 211 | TESTING: testimage |
| 212 | |
| 213 | qemuarm: |
| 214 | extends: .build |
| 215 | parallel: |
| 216 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 217 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 223 | TESTING: testimage |
| 224 | - VIRT: xen |
| 225 | |
| 226 | qemuarmv5: |
| 227 | extends: .build |
| 228 | parallel: |
| 229 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 230 | - DISTRO: poky |
| 231 | KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 232 | TESTING: testimage |
| 233 | - DISTRO: poky-tiny |
| 234 | TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 235 | |
| 236 | sgi575: |
| 237 | extends: .build |
| 238 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 239 | tc1: |
| 240 | extends: .build |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 241 | parallel: |
| 242 | matrix: |
| 243 | - TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 244 | tags: |
| 245 | - x86_64 |
| 246 | |
| 247 | toolchains: |
| 248 | extends: .build |
| 249 | |
| 250 | selftest: |
| 251 | extends: .setup |
| 252 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 253 | - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 254 | - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 2 --select-tag meta-arm --run-all-tests' |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 255 | |
| 256 | # Validate layers are Yocto Project Compatible |
| 257 | check-layers: |
| 258 | extends: .setup |
| 259 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 260 | - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \ |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 261 | "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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 264 | - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 265 | |
| 266 | pending-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 Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 274 | - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/meta-secure-core.yml:lockfile.yml --command \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 275 | "$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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 276 | # 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 |
| 281 | machine-coverage: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 282 | extends: .setup |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 283 | script: |
| 284 | - ./ci/check-machine-coverage |
| 285 | coverage: '/Coverage: \d+/' |
| 286 | |
| 287 | metrics: |
| 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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 295 | |
| 296 | documentation: |
| 297 | extends: .setup |
| 298 | script: |
| 299 | - | |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 300 | # 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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 308 | for CONF in meta-*/documentation/*/conf.py ; do |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 309 | echo Building $CONF... |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 310 | 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/ |