.gitlab-ci.yml 7.8 KB

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