.gitlab-ci.yml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. image: ${MIRROR_GHCR}/siemens/kas/kas:4.3.2
  2. variables:
  3. # These are needed as the k8s executor doesn't respect the container
  4. # entrypoint by default
  5. FF_KUBERNETES_HONOR_ENTRYPOINT: 1
  6. FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
  7. # The default value for KUBERNETES_CPU_REQUEST
  8. CPU_REQUEST: ""
  9. # The default machine tag for the build jobs
  10. DEFAULT_TAG: ""
  11. # The machine tag for the ACS test jobs
  12. ACS_TAG: ""
  13. # The directory to use as the persistent cache (the root for DL_DIR, SSTATE_DIR, etc)
  14. CACHE_DIR: $CI_BUILDS_DIR/persist
  15. # The container mirror to use
  16. MIRROR_GHCR: ghcr.io
  17. # Whether to run the SystemReady ACS tests
  18. ACS_TEST: 0
  19. # The list of extra Kas fragments to be used when building
  20. EXTRA_KAS_FILES: ""
  21. # The NVD API key to use when fetching CVEs
  22. NVDCVE_API_KEY: ""
  23. stages:
  24. - prep
  25. - build
  26. # Common job fragment to get a worker ready
  27. .setup:
  28. when: manual
  29. tags:
  30. - $DEFAULT_TAG
  31. stage: build
  32. interruptible: true
  33. variables:
  34. KAS_WORK_DIR: $CI_PROJECT_DIR/work
  35. KAS_REPO_REF_DIR: $CACHE_DIR/repos
  36. SSTATE_DIR: $CACHE_DIR/sstate
  37. DL_DIR: $CACHE_DIR/downloads
  38. BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
  39. TOOLCHAIN_DIR: $CACHE_DIR/toolchains
  40. IMAGE_DIR: $CI_PROJECT_DIR/work/build/tmp/deploy/images
  41. TOOLCHAIN_LINK_DIR: $CI_PROJECT_DIR/work/build/toolchains
  42. before_script:
  43. - echo KAS_WORK_DIR = $KAS_WORK_DIR
  44. - echo SSTATE_DIR = $SSTATE_DIR
  45. - echo DL_DIR = $DL_DIR
  46. - rm -rf $KAS_WORK_DIR
  47. - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
  48. # Must do this here, as it's the only way to make sure the toolchain is installed on the same builder
  49. - ./ci/get-binary-toolchains $DL_DIR $TOOLCHAIN_DIR $TOOLCHAIN_LINK_DIR
  50. # Generalised fragment to do a Kas build
  51. .build:
  52. extends: .setup
  53. variables:
  54. KUBERNETES_CPU_REQUEST: $CPU_REQUEST
  55. rules:
  56. # Don't run MR pipelines
  57. - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  58. when: never
  59. # Don't run pipelines for tags
  60. - if: $CI_COMMIT_TAG
  61. when: never
  62. # Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
  63. - if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
  64. when: never
  65. # Allow the dev kernels to fail and not fail the overall build
  66. - if: '$KERNEL == "linux-yocto-dev"'
  67. allow_failure: true
  68. # Catch all for everything else
  69. - if: '$KERNEL != "linux-yocto-dev"'
  70. script:
  71. - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME" $EXTRA_KAS_FILES):lockfile.yml
  72. - echo KASFILES=$KASFILES
  73. - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
  74. - kas build $KASFILES
  75. - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
  76. artifacts:
  77. name: "logs"
  78. when: always
  79. paths:
  80. - $CI_PROJECT_DIR/work/build/tmp*/work*/**/temp/log.do_*.*
  81. - $CI_PROJECT_DIR/work/build/tmp*/work*/**/testimage/*
  82. #
  83. # Prep stage, update repositories once.
  84. # Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch
  85. #
  86. update-repos:
  87. extends: .setup
  88. when: on_success
  89. stage: prep
  90. allow_failure:
  91. exit_codes: 128
  92. script:
  93. - |
  94. flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos
  95. # Only generate if doesn't already exist, to allow feature branches to drop one in.
  96. if test -f lockfile.yml; then
  97. echo Using existing lockfile.yml
  98. else
  99. # Be sure that this is the complete list of layers being fetched
  100. kas dump --lock --update ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/clang.yml:ci/meta-virtualization.yml | tee lockfile.yml
  101. fi
  102. artifacts:
  103. name: "lockfile"
  104. paths:
  105. - lockfile.yml
  106. #
  107. # Build stage, the actual build jobs
  108. #
  109. # Available options for building are
  110. # DISTRO: [poky, poky-tiny]
  111. # KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
  112. # TOOLCHAINS: [gcc, clang, external-gccarm]
  113. # TCLIBC: [glibc, musl]
  114. # FIRMWARE: [u-boot, edk2]
  115. # TS: [none, trusted-services]
  116. # VIRT: [none, xen]
  117. # TESTING: testimage
  118. arm-systemready-ir-acs:
  119. extends: .build
  120. timeout: 12h
  121. parallel:
  122. matrix:
  123. # arm-systemready-ir-acs must be specified after fvp-base for ordering
  124. # purposes for the jobs-to-kas output. It is not enough to just have it
  125. # in the job name because fvp-base.yml overwrites the target.
  126. - PLATFORM: fvp-base
  127. ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
  128. tags:
  129. - ${ACS_TAG}
  130. # Validate layers are Yocto Project Compatible
  131. check-layers:
  132. extends: .setup
  133. script:
  134. - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
  135. "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
  136. parallel:
  137. matrix:
  138. - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
  139. corstone1000-fvp:
  140. extends: .build
  141. parallel:
  142. matrix:
  143. - FIRMWARE: corstone1000-firmware-only
  144. TESTING: [testimage, tftf]
  145. - FIRMWARE: none
  146. TESTING: testimage
  147. - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
  148. corstone1000-mps3:
  149. extends: .build
  150. parallel:
  151. matrix:
  152. - FIRMWARE: corstone1000-firmware-only
  153. TESTING: [none, tftf]
  154. - FIRMWARE: none
  155. documentation:
  156. extends: .setup
  157. script:
  158. - |
  159. # This can be removed when the kas container has python3-venv installed
  160. sudo apt-get update && sudo apt-get install --yes python3-venv
  161. python3 -m venv venv
  162. . ./venv/bin/activate
  163. pip3 install -r meta-arm-bsp/documentation/requirements.txt
  164. for CONF in meta-*/documentation/*/conf.py ; do
  165. echo Building $CONF...
  166. SOURCE_DIR=$(dirname $CONF)
  167. MACHINE=$(basename $SOURCE_DIR)
  168. sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
  169. done
  170. test -d build-docs/
  171. artifacts:
  172. paths:
  173. - build-docs/
  174. fvp-base:
  175. extends: .build
  176. parallel:
  177. matrix:
  178. - TS: [none, fvp-base-ts]
  179. TESTING: testimage
  180. - FIRMWARE: edk2
  181. - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
  182. arm-systemready-ir-acs:
  183. extends: .build
  184. timeout: 12h
  185. parallel:
  186. matrix:
  187. # arm-systemready-ir-acs must be specified after fvp-base for ordering
  188. # purposes for the jobs-to-kas output. It is not enough to just have it
  189. # in the job name because fvp-base.yml overwrites the target.
  190. - PLATFORM: [fvp-base, corstone1000-fvp]
  191. ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
  192. tags:
  193. - ${ACS_TAG}
  194. fvps:
  195. extends: .build
  196. genericarm64:
  197. extends: .build
  198. parallel:
  199. matrix:
  200. - TOOLCHAINS: [gcc, clang]
  201. TESTING: testimage
  202. - KERNEL: linux-yocto-dev
  203. TESTING: testimage
  204. juno:
  205. extends: .build
  206. parallel:
  207. matrix:
  208. - TOOLCHAINS: [gcc, clang]
  209. FIRMWARE: [u-boot, edk2]
  210. # What percentage of machines in the layer do we build
  211. machine-coverage:
  212. extends: .setup
  213. script:
  214. - ./ci/check-machine-coverage
  215. coverage: '/Coverage: \d+/'
  216. metrics:
  217. extends: .setup
  218. artifacts:
  219. reports:
  220. metrics: metrics.txt
  221. script:
  222. - kas shell --update --force-checkout ci/base.yml --command \
  223. "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
  224. musca-b1:
  225. extends: .build
  226. musca-s1:
  227. extends: .build
  228. n1sdp:
  229. extends: .build
  230. parallel:
  231. matrix:
  232. - TESTING: [none, n1sdp-ts, n1sdp-optee, tftf]
  233. pending-updates:
  234. extends: .setup
  235. artifacts:
  236. paths:
  237. - update-report
  238. script:
  239. - rm -fr update-report
  240. # This configuration has all of the layers we need enabled
  241. - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/meta-secure-core.yml:lockfile.yml --command \
  242. "$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)"
  243. # Do this on x86 whilst the compilers are x86-only
  244. tags:
  245. - x86_64
  246. qemuarm64-secureboot:
  247. extends: .build
  248. parallel:
  249. matrix:
  250. - KERNEL: [linux-yocto, linux-yocto-rt]
  251. TOOLCHAINS: [gcc, clang]
  252. TCLIBC: [glibc, musl]
  253. TS: [none, qemuarm64-secureboot-ts]
  254. TESTING: testimage
  255. - KERNEL: linux-yocto-dev
  256. TESTING: testimage
  257. qemuarm64:
  258. extends: .build
  259. parallel:
  260. matrix:
  261. - DISTRO: poky
  262. KERNEL: [linux-yocto, linux-yocto-rt]
  263. TOOLCHAINS: [gcc, clang]
  264. FIRMWARE: [u-boot, edk2]
  265. TESTING: testimage
  266. - DISTRO: poky-tiny
  267. TESTING: testimage
  268. - VIRT: xen
  269. - KERNEL: linux-yocto-dev
  270. TESTING: testimage
  271. qemuarm-secureboot:
  272. extends: .build
  273. parallel:
  274. matrix:
  275. - KERNEL: [linux-yocto, linux-yocto-rt]
  276. TOOLCHAINS: [gcc, clang]
  277. TCLIBC: [glibc, musl]
  278. TESTING: testimage
  279. - TOOLCHAINS: external-gccarm
  280. TESTING: testimage
  281. - KERNEL: linux-yocto-dev
  282. TESTING: testimage
  283. qemuarm:
  284. extends: .build
  285. parallel:
  286. matrix:
  287. - DISTRO: poky
  288. KERNEL: [linux-yocto, linux-yocto-rt]
  289. TOOLCHAINS: [gcc, clang]
  290. FIRMWARE: [u-boot, edk2]
  291. TESTING: testimage
  292. - DISTRO: poky-tiny
  293. TESTING: testimage
  294. - VIRT: xen
  295. - KERNEL: linux-yocto-dev
  296. TESTING: testimage
  297. qemuarmv5:
  298. extends: .build
  299. parallel:
  300. matrix:
  301. - DISTRO: poky
  302. KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
  303. TESTING: testimage
  304. - DISTRO: poky-tiny
  305. TESTING: testimage
  306. sbsa-ref:
  307. extends: .build
  308. parallel:
  309. matrix:
  310. - KERNEL: [linux-yocto, linux-yocto-rt]
  311. TOOLCHAINS: [gcc, clang]
  312. TESTING: testimage
  313. - KERNEL: linux-yocto-dev
  314. TESTING: testimage
  315. selftest:
  316. extends: .setup
  317. script:
  318. - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
  319. - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 2 --select-tag meta-arm --run-all-tests'
  320. sgi575:
  321. extends: .build
  322. toolchains:
  323. extends: .build
  324. gcs:
  325. when: on_success
  326. extends: .setup
  327. script:
  328. - kas build meta-arm-gcs/gcs-test.yml