Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 1 | image: ghcr.io/siemens/kas/kas:3.2.3 |
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 | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 7 | # 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 12 | stages: |
| 13 | - prep |
| 14 | - build |
| 15 | |
| 16 | # Common job fragment to get a worker ready |
| 17 | .setup: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 18 | tags: |
| 19 | - $DEFAULT_TAG |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 20 | stage: build |
| 21 | interruptible: true |
| 22 | variables: |
| 23 | KAS_WORK_DIR: $CI_PROJECT_DIR/work |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 24 | KAS_REPO_REF_DIR: $CACHE_DIR/repos |
| 25 | SSTATE_DIR: $CACHE_DIR/sstate |
| 26 | DL_DIR: $CACHE_DIR/downloads |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 27 | BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 28 | TOOLCHAIN_DIR: $CACHE_DIR/toolchains |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 29 | 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 39 | |
| 40 | # Generalised fragment to do a Kas build |
| 41 | .build: |
| 42 | extends: .setup |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 43 | variables: |
| 44 | KUBERNETES_CPU_REQUEST: $CPU_REQUEST |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 45 | 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 60 | script: |
| 61 | - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME") |
Andrew Geissler | ea144b0 | 2023-01-27 16:03:57 -0600 | [diff] [blame] | 62 | - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 63 | - kas build $KASFILES |
| 64 | - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log |
| 65 | artifacts: |
| 66 | name: "logs" |
| 67 | when: on_failure |
| 68 | paths: |
| 69 | - $CI_PROJECT_DIR/work/build/tmp/work*/**/temp/log.do_*.* |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 70 | - $CI_PROJECT_DIR/work/build/tmp/work*/**/testimage/* |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 71 | |
| 72 | # |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 73 | # Prep stage, update repositories once. |
| 74 | # 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] | 75 | # |
| 76 | update-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 Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 86 | # DISTRO: [poky, poky-tiny] |
| 87 | # KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 88 | # TOOLCHAINS: [gcc, clang, armgcc, external-gccarm] |
| 89 | # TCLIBC: [glibc, musl] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 90 | # FIRMWARE: [u-boot, edk2] |
| 91 | # TS: [none, trusted-services] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 92 | # VIRT: [none, xen] |
| 93 | # TESTING: testimage |
| 94 | |
| 95 | corstone500: |
| 96 | extends: .build |
| 97 | parallel: |
| 98 | matrix: |
| 99 | - TESTING: testimage |
| 100 | tags: |
| 101 | - x86_64 |
| 102 | |
| 103 | corstone1000-fvp: |
| 104 | extends: .build |
| 105 | parallel: |
| 106 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 107 | - TESTING: [testimage, tftf] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 108 | tags: |
| 109 | - x86_64 |
| 110 | |
| 111 | corstone1000-mps3: |
| 112 | extends: .build |
| 113 | |
| 114 | fvp-base: |
| 115 | extends: .build |
| 116 | parallel: |
| 117 | matrix: |
| 118 | - TESTING: testimage |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 119 | - FIRMWARE: edk2 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 120 | |
| 121 | fvp-baser-aemv8r64: |
| 122 | extends: .build |
| 123 | parallel: |
| 124 | matrix: |
| 125 | - TESTING: testimage |
| 126 | tags: |
| 127 | - x86_64 |
| 128 | |
| 129 | fvps: |
| 130 | extends: .build |
| 131 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 132 | generic-arm64: |
| 133 | extends: .build |
| 134 | |
| 135 | juno: |
| 136 | extends: .build |
| 137 | parallel: |
| 138 | matrix: |
| 139 | - TOOLCHAINS: [gcc, clang] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 140 | FIRMWARE: [u-boot, edk2] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 141 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 142 | musca-b1: |
| 143 | extends: .build |
| 144 | |
| 145 | musca-s1: |
| 146 | extends: .build |
| 147 | |
| 148 | n1sdp: |
| 149 | extends: .build |
| 150 | parallel: |
| 151 | matrix: |
| 152 | - TOOLCHAINS: [gcc, armgcc] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 153 | TS: [none, n1sdp-ts] |
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: |
| 237 | - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml |
| 238 | - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 1 --run-tests runfvp' |
| 239 | |
| 240 | # Validate layers are Yocto Project Compatible |
| 241 | check-layers: |
| 242 | extends: .setup |
| 243 | script: |
| 244 | - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml --command \ |
| 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 |
Andrew Geissler | ea144b0 | 2023-01-27 16:03:57 -0600 | [diff] [blame] | 258 | - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.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 | - | |
| 284 | sudo pip3 install -r meta-arm-bsp/documentation/requirements.txt |
| 285 | for CONF in meta-*/documentation/*/conf.py ; do |
| 286 | 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/ |