.gitlab-ci.yml 9.8 KB

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