Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 1 | image: ghcr.io/siemens/kas/kas:3.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: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 61 | - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME"):lockfile.yml |
| 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" |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 67 | when: always |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 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: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 80 | - | |
| 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 Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 93 | |
| 94 | # |
| 95 | # Build stage, the actual build jobs |
| 96 | # |
| 97 | # Available options for building are |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 98 | # DISTRO: [poky, poky-tiny] |
| 99 | # KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 100 | # TOOLCHAINS: [gcc, clang, external-gccarm] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 101 | # TCLIBC: [glibc, musl] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 102 | # FIRMWARE: [u-boot, edk2] |
| 103 | # TS: [none, trusted-services] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 104 | # VIRT: [none, xen] |
| 105 | # TESTING: testimage |
| 106 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 107 | corstone1000-fvp: |
| 108 | extends: .build |
| 109 | parallel: |
| 110 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 111 | - TESTING: [testimage, tftf] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 112 | tags: |
| 113 | - x86_64 |
| 114 | |
| 115 | corstone1000-mps3: |
| 116 | extends: .build |
| 117 | |
| 118 | fvp-base: |
| 119 | extends: .build |
| 120 | parallel: |
| 121 | matrix: |
| 122 | - TESTING: testimage |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 123 | - FIRMWARE: edk2 |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 124 | |
| 125 | fvp-baser-aemv8r64: |
| 126 | extends: .build |
| 127 | parallel: |
| 128 | matrix: |
| 129 | - TESTING: testimage |
| 130 | tags: |
| 131 | - x86_64 |
| 132 | |
| 133 | fvps: |
| 134 | extends: .build |
| 135 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 136 | generic-arm64: |
| 137 | extends: .build |
| 138 | |
| 139 | juno: |
| 140 | extends: .build |
| 141 | parallel: |
| 142 | matrix: |
| 143 | - TOOLCHAINS: [gcc, clang] |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 144 | FIRMWARE: [u-boot, edk2] |
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 | musca-b1: |
| 147 | extends: .build |
| 148 | |
| 149 | musca-s1: |
| 150 | extends: .build |
| 151 | |
| 152 | n1sdp: |
| 153 | extends: .build |
| 154 | parallel: |
| 155 | matrix: |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 156 | - TS: [none, n1sdp-ts] |
Andrew Geissler | 2edf064 | 2023-09-11 08:24:07 -0400 | [diff] [blame] | 157 | - OPTEE: [none, n1sdp-optee] |
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 | qemu-generic-arm64: |
| 160 | extends: .build |
| 161 | parallel: |
| 162 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 163 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 164 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 165 | TESTING: testimage |
| 166 | |
| 167 | qemuarm64-secureboot: |
| 168 | extends: .build |
| 169 | parallel: |
| 170 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 171 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 172 | TOOLCHAINS: [gcc, clang] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 173 | TCLIBC: [glibc, musl] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 174 | TS: [none, qemuarm64-secureboot-ts] |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 175 | TESTING: testimage |
| 176 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 177 | qemuarm64: |
| 178 | extends: .build |
| 179 | parallel: |
| 180 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 181 | - DISTRO: poky |
| 182 | KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 183 | TOOLCHAINS: [gcc, clang] |
| 184 | FIRMWARE: [u-boot, edk2] |
| 185 | TESTING: testimage |
| 186 | - DISTRO: poky-tiny |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 187 | TESTING: testimage |
| 188 | - VIRT: xen |
| 189 | |
| 190 | qemuarm-secureboot: |
| 191 | extends: .build |
| 192 | parallel: |
| 193 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 194 | - KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
Patrick Williams | b542dec | 2023-06-09 01:26:37 -0500 | [diff] [blame] | 195 | TOOLCHAINS: [gcc, clang] |
| 196 | TCLIBC: [glibc, musl] |
| 197 | TESTING: testimage |
| 198 | - TOOLCHAINS: external-gccarm |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 199 | TESTING: testimage |
| 200 | |
| 201 | qemuarm: |
| 202 | extends: .build |
| 203 | parallel: |
| 204 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 205 | - DISTRO: poky |
| 206 | KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 207 | TOOLCHAINS: [gcc, clang] |
| 208 | FIRMWARE: [u-boot, edk2] |
| 209 | TESTING: testimage |
| 210 | - DISTRO: poky-tiny |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 211 | TESTING: testimage |
| 212 | - VIRT: xen |
| 213 | |
| 214 | qemuarmv5: |
| 215 | extends: .build |
| 216 | parallel: |
| 217 | matrix: |
Andrew Geissler | 2daf84b | 2023-03-31 09:57:23 -0500 | [diff] [blame] | 218 | - DISTRO: poky |
| 219 | KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt] |
| 220 | TESTING: testimage |
| 221 | - DISTRO: poky-tiny |
| 222 | TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 223 | |
| 224 | sgi575: |
| 225 | extends: .build |
| 226 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 227 | tc1: |
| 228 | extends: .build |
Patrick Williams | 8e7b46e | 2023-05-01 14:19:06 -0500 | [diff] [blame] | 229 | parallel: |
| 230 | matrix: |
| 231 | - TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 232 | tags: |
| 233 | - x86_64 |
| 234 | |
| 235 | toolchains: |
| 236 | extends: .build |
| 237 | |
| 238 | selftest: |
| 239 | extends: .setup |
| 240 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 241 | - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 242 | - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 1 --run-tests runfvp' |
| 243 | |
| 244 | # Validate layers are Yocto Project Compatible |
| 245 | check-layers: |
| 246 | extends: .setup |
| 247 | script: |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 248 | - 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] | 249 | "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency" |
| 250 | parallel: |
| 251 | matrix: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 252 | - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 253 | |
| 254 | pending-updates: |
| 255 | extends: .setup |
| 256 | artifacts: |
| 257 | paths: |
| 258 | - update-report |
| 259 | script: |
| 260 | - rm -fr update-report |
| 261 | # This configuration has all of the layers we need enabled |
Andrew Geissler | 23e0279 | 2023-07-21 09:06:10 -0500 | [diff] [blame] | 262 | - 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] | 263 | "$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] | 264 | # Do this on x86 whilst the compilers are x86-only |
| 265 | tags: |
| 266 | - x86_64 |
| 267 | |
| 268 | # What percentage of machines in the layer do we build |
| 269 | machine-coverage: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 270 | extends: .setup |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 271 | script: |
| 272 | - ./ci/check-machine-coverage |
| 273 | coverage: '/Coverage: \d+/' |
| 274 | |
| 275 | metrics: |
| 276 | extends: .setup |
| 277 | artifacts: |
| 278 | reports: |
| 279 | metrics: metrics.txt |
| 280 | script: |
| 281 | - kas shell --update --force-checkout ci/base.yml --command \ |
| 282 | "$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] | 283 | |
| 284 | documentation: |
| 285 | extends: .setup |
| 286 | script: |
| 287 | - | |
| 288 | sudo pip3 install -r meta-arm-bsp/documentation/requirements.txt |
| 289 | for CONF in meta-*/documentation/*/conf.py ; do |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 290 | echo Building $CONF... |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 291 | SOURCE_DIR=$(dirname $CONF) |
| 292 | MACHINE=$(basename $SOURCE_DIR) |
| 293 | sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE |
| 294 | done |
| 295 | test -d build-docs/ |
| 296 | artifacts: |
| 297 | paths: |
| 298 | - build-docs/ |