.gitlab-ci.yml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. image: ${MIRROR_GHCR}/siemens/kas/kas:4.4
  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_BUILD_DIR: $KAS_WORK_DIR/build
  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: $KAS_BUILD_DIR/tmp/deploy/images
  41. TOOLCHAIN_LINK_DIR: $KAS_BUILD_DIR/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. # Generalised fragment to do a Kas build
  49. .build:
  50. extends: .setup
  51. variables:
  52. KUBERNETES_CPU_REQUEST: $CPU_REQUEST
  53. rules:
  54. # Don't run MR pipelines
  55. - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  56. when: never
  57. # Don't run pipelines for tags
  58. - if: $CI_COMMIT_TAG
  59. when: never
  60. # Don't run if BUILD_ENABLE_REGEX is set, but the job doesn't match the regex
  61. - if: '$BUILD_ENABLE_REGEX != null && $CI_JOB_NAME !~ $BUILD_ENABLE_REGEX'
  62. when: never
  63. # Allow the dev kernels to fail and not fail the overall build
  64. - if: '$KERNEL == "linux-yocto-dev"'
  65. allow_failure: true
  66. # Catch all for everything else
  67. - if: '$KERNEL != "linux-yocto-dev"'
  68. script:
  69. - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME" $EXTRA_KAS_FILES):lockfile.yml
  70. - echo KASFILES=$KASFILES
  71. - kas dump --update --force-checkout --resolve-refs --resolve-env $KASFILES
  72. - kas build $KASFILES
  73. - ./ci/check-warnings $KAS_BUILD_DIR/warnings.log
  74. - kas shell ci/base.yml:lockfile.yml --command "$CI_PROJECT_DIR/ci/junit.sh $KAS_WORK_DIR/build"
  75. artifacts:
  76. name: "logs"
  77. when: always
  78. paths:
  79. - $KAS_BUILD_DIR/tmp*/work*/**/temp/log.do_*.*
  80. - $KAS_BUILD_DIR/tmp*/work*/**/testimage/*
  81. reports:
  82. junit: $KAS_BUILD_DIR/tmp/log/oeqa/junit.xml
  83. #
  84. # Prep stage, update repositories once.
  85. # Set the CI variable CI_CLEAN_REPOS=1 to refetch the respositories from scratch
  86. #
  87. update-repos:
  88. extends: .setup
  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 (VIRT _must_ be last for ssh override)
  110. # DISTRO: [poky, poky-altcfg, poky-tiny]
  111. # KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
  112. # TOOLCHAINS: [gcc, clang]
  113. # TCLIBC: [glibc, musl]
  114. # FIRMWARE: [u-boot, edk2]
  115. # TS: [none, trusted-services]
  116. # TESTING: testimage
  117. # SECUREDEBUG: [none, secure-debug]
  118. # VIRT: [none, xen]
  119. arm-systemready-ir-acs:
  120. extends: .build
  121. timeout: 12h
  122. parallel:
  123. matrix:
  124. # arm-systemready-ir-acs must be specified after fvp-base for ordering
  125. # purposes for the jobs-to-kas output. It is not enough to just have it
  126. # in the job name because fvp-base.yml overwrites the target.
  127. - PLATFORM: [fvp-base, corstone1000-fvp]
  128. ARM_SYSTEMREADY_IR_ACS: arm-systemready-ir-acs
  129. tags:
  130. - ${ACS_TAG}
  131. # Validate layers are Yocto Project Compatible
  132. check-layers:
  133. extends: .setup
  134. script:
  135. - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml:lockfile.yml --command \
  136. "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR/meta-* $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
  137. parallel:
  138. matrix:
  139. - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain]
  140. corstone1000-fvp:
  141. extends: .build
  142. parallel:
  143. matrix:
  144. - FIRMWARE: corstone1000-firmware-only
  145. TESTING: [testimage, tftf]
  146. - FIRMWARE: none
  147. TESTING: testimage
  148. - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
  149. corstone1000-mps3:
  150. extends: .build
  151. parallel:
  152. matrix:
  153. - FIRMWARE: corstone1000-firmware-only
  154. TESTING: [none, tftf]
  155. - FIRMWARE: none
  156. SECUREDEBUG: [none, secure-debug]
  157. documentation:
  158. extends: .setup
  159. script:
  160. - |
  161. # This can be removed when the kas container has python3-venv installed
  162. sudo apt-get update && sudo apt-get install --yes python3-venv
  163. python3 -m venv venv
  164. . ./venv/bin/activate
  165. pip3 install -r meta-arm-bsp/documentation/requirements.txt
  166. for CONF in meta-*/documentation/*/conf.py ; do
  167. echo Building $CONF...
  168. SOURCE_DIR=$(dirname $CONF)
  169. MACHINE=$(basename $SOURCE_DIR)
  170. sphinx-build -vW $SOURCE_DIR build-docs/$MACHINE
  171. done
  172. test -d build-docs/
  173. artifacts:
  174. paths:
  175. - build-docs/
  176. fvp-base:
  177. extends: .build
  178. parallel:
  179. matrix:
  180. - TS: [none, fvp-base-ts]
  181. TESTING: testimage
  182. - FIRMWARE: [u-boot, edk2]
  183. TESTING: testimage
  184. - SYSTEMREADY_FIRMWARE: arm-systemready-firmware
  185. fvps:
  186. extends: .build
  187. genericarm64:
  188. extends: .build
  189. parallel:
  190. matrix:
  191. - TOOLCHAINS: [gcc, clang]
  192. TESTING: testimage
  193. - KERNEL: linux-yocto-dev
  194. TESTING: testimage
  195. juno:
  196. extends: .build
  197. parallel:
  198. matrix:
  199. - TOOLCHAINS: [gcc, clang]
  200. FIRMWARE: [u-boot, edk2]
  201. # What percentage of machines in the layer do we build
  202. machine-coverage:
  203. extends: .setup
  204. script:
  205. - ./ci/check-machine-coverage
  206. coverage: '/Coverage: \d+/'
  207. metrics:
  208. extends: .setup
  209. artifacts:
  210. reports:
  211. metrics: metrics.txt
  212. script:
  213. - kas shell --update --force-checkout ci/base.yml --command \
  214. "$CI_PROJECT_DIR/ci/patchreview $CI_PROJECT_DIR/meta-* --verbose --metrics $CI_PROJECT_DIR/metrics.txt"
  215. musca-b1:
  216. extends: .build
  217. musca-s1:
  218. extends: .build
  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
  227. - kas shell --update --force-checkout ci/qemuarm64.yml:ci/meta-openembedded.yml:ci/meta-secure-core.yml:lockfile.yml --command \
  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)"
  229. # Do this on x86 whilst the compilers are x86-only
  230. tags:
  231. - x86_64
  232. qemuarm64-secureboot:
  233. extends: .build
  234. parallel:
  235. matrix:
  236. - KERNEL: [linux-yocto, linux-yocto-rt]
  237. TOOLCHAINS: [gcc, clang]
  238. TCLIBC: [glibc, musl]
  239. TS: [none, qemuarm64-secureboot-ts]
  240. TESTING: testimage
  241. - TOOLCHAINS: [gcc, clang]
  242. TS: [none, qemuarm64-secureboot-ts]
  243. UEFISB: [none, uefi-secureboot]
  244. TESTING: testimage
  245. - KERNEL: linux-yocto-dev
  246. TESTING: testimage
  247. qemuarm64:
  248. extends: .build
  249. parallel:
  250. matrix:
  251. - DISTRO: poky
  252. KERNEL: [linux-yocto, linux-yocto-rt]
  253. TOOLCHAINS: [gcc, clang]
  254. FIRMWARE: [u-boot, edk2]
  255. TESTING: testimage
  256. - DISTRO: poky-tiny
  257. TESTING: testimage
  258. - VIRT: xen
  259. - KERNEL: linux-yocto-dev
  260. TESTING: testimage
  261. qemuarm-secureboot:
  262. extends: .build
  263. parallel:
  264. matrix:
  265. - KERNEL: [linux-yocto, linux-yocto-rt]
  266. TOOLCHAINS: [gcc, clang]
  267. TCLIBC: [glibc, musl]
  268. TESTING: testimage
  269. - DISTRO: [poky, poky-altcfg]
  270. TESTING: testimage
  271. - KERNEL: linux-yocto-dev
  272. TESTING: testimage
  273. qemuarm:
  274. extends: .build
  275. parallel:
  276. matrix:
  277. - DISTRO: poky
  278. KERNEL: [linux-yocto, linux-yocto-rt]
  279. TOOLCHAINS: [gcc, clang]
  280. FIRMWARE: [u-boot, edk2]
  281. TESTING: testimage
  282. - DISTRO: poky-tiny
  283. TESTING: testimage
  284. - VIRT: xen
  285. - KERNEL: linux-yocto-dev
  286. TESTING: testimage
  287. qemuarmv5:
  288. extends: .build
  289. parallel:
  290. matrix:
  291. - DISTRO: poky
  292. KERNEL: [linux-yocto, linux-yocto-dev, linux-yocto-rt]
  293. TESTING: testimage
  294. - DISTRO: poky-tiny
  295. TESTING: testimage
  296. sbsa-ref:
  297. extends: .build
  298. parallel:
  299. matrix:
  300. - KERNEL: [linux-yocto, linux-yocto-rt]
  301. TOOLCHAINS: [gcc, clang]
  302. TESTING: testimage
  303. - DISTRO: poky-altcfg
  304. TESTING: testimage
  305. - KERNEL: linux-yocto-dev
  306. TESTING: testimage
  307. selftest:
  308. extends: .setup
  309. script:
  310. - KASFILES=./ci/qemuarm64.yml:./ci/selftest.yml:lockfile.yml
  311. - kas shell --update --force-checkout $KASFILES -c 'oe-selftest --num-processes 2 --select-tag meta-arm --run-all-tests'
  312. sgi575:
  313. extends: .build
  314. toolchains:
  315. extends: .build