.gitlab-ci.yml 10.0 KB

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