Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 1 | image: ghcr.io/siemens/kas/kas:3.2 |
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 |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 45 | only: |
| 46 | variables: |
| 47 | - $BUILD_ENABLE_REGEX == null || $CI_JOB_NAME =~ $BUILD_ENABLE_REGEX |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 48 | script: |
| 49 | - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME") |
Andrew Geissler | ea144b0 | 2023-01-27 16:03:57 -0600 | [diff] [blame] | 50 | - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 51 | - kas build $KASFILES |
| 52 | - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log |
| 53 | artifacts: |
| 54 | name: "logs" |
| 55 | when: on_failure |
| 56 | paths: |
| 57 | - $CI_PROJECT_DIR/work/build/tmp/work*/**/temp/log.do_*.* |
Andrew Geissler | 9347dd4 | 2023-03-03 12:38:41 -0600 | [diff] [blame] | 58 | - $CI_PROJECT_DIR/work/build/tmp/work*/**/testimage/* |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 59 | |
| 60 | # |
| 61 | # Prep stage, update repositories once |
| 62 | # |
| 63 | update-repos: |
| 64 | extends: .setup |
| 65 | stage: prep |
| 66 | script: |
| 67 | - flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos |
| 68 | |
| 69 | # |
| 70 | # Build stage, the actual build jobs |
| 71 | # |
| 72 | # Available options for building are |
| 73 | # TOOLCHAINS: [gcc, clang, armgcc, external-gccarm] |
| 74 | # TCLIBC: [glibc, musl] |
| 75 | # FIRMWARE: [uboot, edk2] |
| 76 | # VIRT: [none, xen] |
| 77 | # TESTING: testimage |
| 78 | |
| 79 | corstone500: |
| 80 | extends: .build |
| 81 | parallel: |
| 82 | matrix: |
| 83 | - TESTING: testimage |
| 84 | tags: |
| 85 | - x86_64 |
| 86 | |
| 87 | corstone1000-fvp: |
| 88 | extends: .build |
| 89 | parallel: |
| 90 | matrix: |
| 91 | - TESTING: [testimage,tftf] |
| 92 | tags: |
| 93 | - x86_64 |
| 94 | |
| 95 | corstone1000-mps3: |
| 96 | extends: .build |
| 97 | |
| 98 | fvp-base: |
| 99 | extends: .build |
| 100 | parallel: |
| 101 | matrix: |
| 102 | - TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 103 | |
| 104 | fvp-base-arm32: |
| 105 | extends: .build |
| 106 | parallel: |
| 107 | matrix: |
| 108 | - TOOLCHAINS: [gcc, external-gccarm] |
| 109 | TESTING: testimage |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 110 | |
| 111 | fvp-baser-aemv8r64: |
| 112 | extends: .build |
| 113 | parallel: |
| 114 | matrix: |
| 115 | - TESTING: testimage |
| 116 | tags: |
| 117 | - x86_64 |
| 118 | |
| 119 | fvps: |
| 120 | extends: .build |
| 121 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 122 | generic-arm64: |
| 123 | extends: .build |
| 124 | |
| 125 | juno: |
| 126 | extends: .build |
| 127 | parallel: |
| 128 | matrix: |
| 129 | - TOOLCHAINS: [gcc, clang] |
| 130 | FIRMWARE: [uboot, edk2] |
| 131 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 132 | musca-b1: |
| 133 | extends: .build |
| 134 | |
| 135 | musca-s1: |
| 136 | extends: .build |
| 137 | |
| 138 | n1sdp: |
| 139 | extends: .build |
| 140 | parallel: |
| 141 | matrix: |
| 142 | - TOOLCHAINS: [gcc, armgcc] |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 143 | TS: [none, trusted-services] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 144 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 145 | qemu-generic-arm64: |
| 146 | extends: .build |
| 147 | parallel: |
| 148 | matrix: |
| 149 | - TOOLCHAINS: [gcc, clang] |
| 150 | TESTING: testimage |
| 151 | |
| 152 | qemuarm64-secureboot: |
| 153 | extends: .build |
| 154 | parallel: |
| 155 | matrix: |
| 156 | - TOOLCHAINS: [gcc, clang] |
| 157 | TCLIBC: [glibc, musl] |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame] | 158 | TS: [none, trusted-services] |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 159 | TESTING: testimage |
| 160 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 161 | qemuarm64: |
| 162 | extends: .build |
| 163 | parallel: |
| 164 | matrix: |
| 165 | - TOOLCHAINS: [gcc, clang] |
| 166 | EFI: [uboot, edk2] |
| 167 | TESTING: testimage |
| 168 | - VIRT: xen |
| 169 | |
| 170 | qemuarm-secureboot: |
| 171 | extends: .build |
| 172 | parallel: |
| 173 | matrix: |
| 174 | - TOOLCHAINS: [gcc, clang] |
| 175 | TESTING: testimage |
| 176 | |
| 177 | qemuarm: |
| 178 | extends: .build |
| 179 | parallel: |
| 180 | matrix: |
| 181 | - TOOLCHAINS: [gcc, clang] |
| 182 | EFI: [uboot, edk2] |
| 183 | TESTING: testimage |
| 184 | - VIRT: xen |
| 185 | |
| 186 | qemuarmv5: |
| 187 | extends: .build |
| 188 | parallel: |
| 189 | matrix: |
| 190 | - TESTING: testimage |
| 191 | |
| 192 | sgi575: |
| 193 | extends: .build |
| 194 | |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 195 | tc1: |
| 196 | extends: .build |
| 197 | tags: |
| 198 | - x86_64 |
| 199 | |
| 200 | toolchains: |
| 201 | extends: .build |
| 202 | |
| 203 | selftest: |
| 204 | extends: .setup |
| 205 | script: |
| 206 | - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml |
| 207 | - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 1 --run-tests runfvp' |
| 208 | |
| 209 | # Validate layers are Yocto Project Compatible |
| 210 | check-layers: |
| 211 | extends: .setup |
| 212 | script: |
| 213 | - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml --command \ |
| 214 | "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency" |
| 215 | parallel: |
| 216 | matrix: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 217 | - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain] |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 218 | |
| 219 | pending-updates: |
| 220 | extends: .setup |
| 221 | artifacts: |
| 222 | paths: |
| 223 | - update-report |
| 224 | script: |
| 225 | - rm -fr update-report |
| 226 | # This configuration has all of the layers we need enabled |
Andrew Geissler | ea144b0 | 2023-01-27 16:03:57 -0600 | [diff] [blame] | 227 | - 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] | 228 | "$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] | 229 | # Do this on x86 whilst the compilers are x86-only |
| 230 | tags: |
| 231 | - x86_64 |
| 232 | |
| 233 | # What percentage of machines in the layer do we build |
| 234 | machine-coverage: |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 235 | extends: .setup |
Brad Bishop | bec4ebc | 2022-08-03 09:55:16 -0400 | [diff] [blame] | 236 | script: |
| 237 | - ./ci/check-machine-coverage |
| 238 | coverage: '/Coverage: \d+/' |
| 239 | |
| 240 | metrics: |
| 241 | extends: .setup |
| 242 | artifacts: |
| 243 | reports: |
| 244 | metrics: metrics.txt |
| 245 | script: |
| 246 | - kas shell --update --force-checkout ci/base.yml --command \ |
| 247 | "$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] | 248 | |
| 249 | documentation: |
| 250 | extends: .setup |
| 251 | script: |
| 252 | - | |
| 253 | sudo pip3 install -r meta-arm-bsp/documentation/requirements.txt |
| 254 | for CONF in meta-*/documentation/*/conf.py ; do |
| 255 | SOURCE_DIR=$(dirname $CONF) |
| 256 | MACHINE=$(basename $SOURCE_DIR) |
| 257 | sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE |
| 258 | done |
| 259 | test -d build-docs/ |
| 260 | artifacts: |
| 261 | paths: |
| 262 | - build-docs/ |