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 |
| 12 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 13 | stages: |
| 14 | - prep |
| 15 | - build |
| 16 | |
| 17 | # Common job fragment to get a worker ready |
| 18 | .setup: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 19 | tags: |
| 20 | - $DEFAULT_TAG |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 21 | stage: build |
| 22 | interruptible: true |
| 23 | variables: |
| 24 | KAS_WORK_DIR: $CI_PROJECT_DIR/work |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 25 | KAS_REPO_REF_DIR: $CACHE_DIR/repos |
| 26 | SSTATE_DIR: $CACHE_DIR/sstate |
| 27 | DL_DIR: $CACHE_DIR/downloads |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 28 | BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 29 | TOOLCHAIN_DIR: $CACHE_DIR/toolchains |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 30 | 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 40 | |
| 41 | # Generalised fragment to do a Kas build |
| 42 | .build: |
| 43 | extends: .setup |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 44 | variables: |
| 45 | KUBERNETES_CPU_REQUEST: $CPU_REQUEST |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 46 | 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 61 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 62 | - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME"):lockfile.yml |
| 63 | - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 64 | - kas build $KASFILES |
| 65 | - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log |
| 66 | artifacts: |
| 67 | name: "logs" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 68 | when: always |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 69 | paths: |
| 70 | - $CI_PROJECT_DIR/work/build/tmp/work*/**/temp/log.do_*.* |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 71 | - $CI_PROJECT_DIR/work/build/tmp/work*/**/testimage/* |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 72 | |
| 73 | # |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 74 | # Prep stage, update repositories once. |
| 75 | # 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] | 76 | # |
| 77 | update-repos: |
| 78 | extends: .setup |
| 79 | stage: prep |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 80 | allow_failure: |
| 81 | exit_codes: 128 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 82 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 83 | - | |
| 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 96 | |
| 97 | # |
| 98 | # Build stage, the actual build jobs |
| 99 | # |
| 100 | # Available options for building are |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 101 | # DISTRO: [poky, poky-tiny] |
| 102 | # KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 103 | # TOOLCHAINS: [gcc, clang, external-gccarm] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 104 | # TCLIBC: [glibc, musl] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 105 | # FIRMWARE: [u-boot, edk2] |
| 106 | # TS: [none, trusted-services] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 107 | # VIRT: [none, xen] |
| 108 | # TESTING: testimage |
| 109 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 110 | corstone1000-fvp: |
| 111 | extends: .build |
| 112 | parallel: |
| 113 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 114 | - TESTING: [testimage, tftf] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 115 | |
| 116 | corstone1000-mps3: |
| 117 | extends: .build |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 118 | parallel: |
| 119 | matrix: |
| 120 | - TESTING: [none, tftf] |
| 121 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 122 | |
| 123 | fvp-base: |
| 124 | extends: .build |
| 125 | parallel: |
| 126 | matrix: |
| 127 | - TESTING: testimage |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 128 | - FIRMWARE: edk2 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 129 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 130 | fvps: |
| 131 | extends: .build |
| 132 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 133 | generic-arm64: |
| 134 | extends: .build |
| 135 | |
| 136 | juno: |
| 137 | extends: .build |
| 138 | parallel: |
| 139 | matrix: |
| 140 | - TOOLCHAINS: [gcc, clang] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 141 | FIRMWARE: [u-boot, edk2] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 142 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 143 | musca-b1: |
| 144 | extends: .build |
| 145 | |
| 146 | musca-s1: |
| 147 | extends: .build |
| 148 | |
| 149 | n1sdp: |
| 150 | extends: .build |
| 151 | parallel: |
| 152 | matrix: |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 153 | - TESTING: [none, n1sdp-ts, n1sdp-optee, tftf] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 154 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 155 | qemu-generic-arm64: |
| 156 | extends: .build |
| 157 | parallel: |
| 158 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 159 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 160 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 161 | TESTING: testimage |
| 162 | |
| 163 | qemuarm64-secureboot: |
| 164 | extends: .build |
| 165 | parallel: |
| 166 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 167 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 168 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 169 | TCLIBC: [glibc, musl] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 170 | TS: [none, qemuarm64-secureboot-ts] |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 171 | TESTING: testimage |
| 172 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 173 | qemuarm64: |
| 174 | extends: .build |
| 175 | parallel: |
| 176 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 177 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 183 | TESTING: testimage |
| 184 | - VIRT: xen |
| 185 | |
| 186 | qemuarm-secureboot: |
| 187 | extends: .build |
| 188 | parallel: |
| 189 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 190 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 191 | TOOLCHAINS: [gcc, clang] |
| 192 | TCLIBC: [glibc, musl] |
| 193 | TESTING: testimage |
| 194 | - TOOLCHAINS: external-gccarm |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 195 | TESTING: testimage |
| 196 | |
| 197 | qemuarm: |
| 198 | extends: .build |
| 199 | parallel: |
| 200 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 201 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 207 | TESTING: testimage |
| 208 | - VIRT: xen |
| 209 | |
| 210 | qemuarmv5: |
| 211 | extends: .build |
| 212 | parallel: |
| 213 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 214 | - DISTRO: poky |
| 215 | KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 216 | TESTING: testimage |
| 217 | - DISTRO: poky-tiny |
| 218 | TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 219 | |
| 220 | sgi575: |
| 221 | extends: .build |
| 222 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 223 | tc1: |
| 224 | extends: .build |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 225 | parallel: |
| 226 | matrix: |
| 227 | - TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 228 | tags: |
| 229 | - x86_64 |
| 230 | |
| 231 | toolchains: |
| 232 | extends: .build |
| 233 | |
| 234 | selftest: |
| 235 | extends: .setup |
| 236 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 237 | - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 238 | - 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] | 239 | |
| 240 | # Validate layers are Yocto Project Compatible |
| 241 | check-layers: |
| 242 | extends: .setup |
| 243 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 244 | - 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] | 245 | "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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 248 | - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 249 | |
| 250 | pending-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 Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 258 | - 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] | 259 | "$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] | 260 | # 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 |
| 265 | machine-coverage: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 266 | extends: .setup |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 267 | script: |
| 268 | - ./ci/check-machine-coverage |
| 269 | coverage: '/Coverage: \d+/' |
| 270 | |
| 271 | metrics: |
| 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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 279 | |
| 280 | documentation: |
| 281 | extends: .setup |
| 282 | script: |
| 283 | - | |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 284 | # 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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 292 | for CONF in meta-*/documentation/*/conf.py ; do |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 293 | echo Building $CONF... |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 294 | 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/ |