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 | tags: |
| 116 | - x86_64 |
| 117 | |
| 118 | corstone1000-mps3: |
| 119 | extends: .build |
| 120 | |
| 121 | fvp-base: |
| 122 | extends: .build |
| 123 | parallel: |
| 124 | matrix: |
| 125 | - TESTING: testimage |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 126 | - FIRMWARE: edk2 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 127 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 128 | fvps: |
| 129 | extends: .build |
| 130 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 131 | generic-arm64: |
| 132 | extends: .build |
| 133 | |
| 134 | juno: |
| 135 | extends: .build |
| 136 | parallel: |
| 137 | matrix: |
| 138 | - TOOLCHAINS: [gcc, clang] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 139 | FIRMWARE: [u-boot, edk2] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 140 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 141 | musca-b1: |
| 142 | extends: .build |
| 143 | |
| 144 | musca-s1: |
| 145 | extends: .build |
| 146 | |
| 147 | n1sdp: |
| 148 | extends: .build |
| 149 | parallel: |
| 150 | matrix: |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 151 | - TS: [none, n1sdp-ts] |
Andrew Geissler | 2edf064 | 2023-09-11 08:24:07 -0400 | [diff] [blame] | 152 | - OPTEE: [none, n1sdp-optee] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 153 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 154 | qemu-generic-arm64: |
| 155 | extends: .build |
| 156 | parallel: |
| 157 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 158 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 159 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 160 | TESTING: testimage |
| 161 | |
| 162 | qemuarm64-secureboot: |
| 163 | extends: .build |
| 164 | parallel: |
| 165 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 166 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 167 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 168 | TCLIBC: [glibc, musl] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 169 | TS: [none, qemuarm64-secureboot-ts] |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 170 | TESTING: testimage |
| 171 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 172 | qemuarm64: |
| 173 | extends: .build |
| 174 | parallel: |
| 175 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 176 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 182 | TESTING: testimage |
| 183 | - VIRT: xen |
| 184 | |
| 185 | qemuarm-secureboot: |
| 186 | extends: .build |
| 187 | parallel: |
| 188 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 189 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 190 | TOOLCHAINS: [gcc, clang] |
| 191 | TCLIBC: [glibc, musl] |
| 192 | TESTING: testimage |
| 193 | - TOOLCHAINS: external-gccarm |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 194 | TESTING: testimage |
| 195 | |
| 196 | qemuarm: |
| 197 | extends: .build |
| 198 | parallel: |
| 199 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 200 | - 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 206 | TESTING: testimage |
| 207 | - VIRT: xen |
| 208 | |
| 209 | qemuarmv5: |
| 210 | extends: .build |
| 211 | parallel: |
| 212 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 213 | - DISTRO: poky |
| 214 | KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 215 | TESTING: testimage |
| 216 | - DISTRO: poky-tiny |
| 217 | TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 218 | |
| 219 | sgi575: |
| 220 | extends: .build |
| 221 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 222 | tc1: |
| 223 | extends: .build |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 224 | parallel: |
| 225 | matrix: |
| 226 | - TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 227 | tags: |
| 228 | - x86_64 |
| 229 | |
| 230 | toolchains: |
| 231 | extends: .build |
| 232 | |
| 233 | selftest: |
| 234 | extends: .setup |
| 235 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 236 | - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 237 | - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 1 --run-tests runfvp' |
| 238 | |
| 239 | # Validate layers are Yocto Project Compatible |
| 240 | check-layers: |
| 241 | extends: .setup |
| 242 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 243 | - 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] | 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 Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 247 | - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 248 | |
| 249 | pending-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 Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 257 | - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:lockfile.yml --command \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 258 | "$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] | 259 | # 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 |
| 264 | machine-coverage: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 265 | extends: .setup |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 266 | script: |
| 267 | - ./ci/check-machine-coverage |
| 268 | coverage: '/Coverage: \d+/' |
| 269 | |
| 270 | metrics: |
| 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 Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 278 | |
| 279 | documentation: |
| 280 | extends: .setup |
| 281 | script: |
| 282 | - | |
Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame] | 283 | # This can be removed when the kas container has python3-venv installed |
| 284 | sudo apt-get update && sudo apt-get install --yes python3-venv |
| 285 | |
| 286 | python3 -m venv venv |
| 287 | . ./venv/bin/activate |
| 288 | |
| 289 | pip3 install -r meta-arm-bsp/documentation/requirements.txt |
| 290 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 291 | for CONF in meta-*/documentation/*/conf.py ; do |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 292 | echo Building $CONF... |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 293 | SOURCE_DIR=$(dirname $CONF) |
| 294 | MACHINE=$(basename $SOURCE_DIR) |
| 295 | sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE |
| 296 | done |
| 297 | test -d build-docs/ |
| 298 | artifacts: |
| 299 | paths: |
| 300 | - build-docs/ |