2
1

gitlab-ci.yml.in 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. stages:
  2. - download
  3. - test
  4. before_script:
  5. - git config --global --add safe.directory ${CI_PROJECT_DIR}
  6. .check-check-package_base:
  7. stage: test
  8. script:
  9. - python3 -m pytest -v utils/checkpackagelib/
  10. .check-check-symbol_base:
  11. stage: test
  12. script:
  13. - python3 -m pytest -v utils/checksymbolslib/
  14. .check-DEVELOPERS_base:
  15. stage: test
  16. script:
  17. - utils/get-developers -v
  18. .check-package_base:
  19. stage: test
  20. script:
  21. - make check-package
  22. .check-symbol_base:
  23. stage: test
  24. script:
  25. - utils/check-symbols
  26. .defconfig_check:
  27. stage: test
  28. script:
  29. - DEFCONFIG_NAME=$(echo ${CI_JOB_NAME} | sed -e 's,_check$,,g')
  30. - echo "Configure Buildroot for ${DEFCONFIG_NAME}"
  31. - make ${DEFCONFIG_NAME}
  32. - support/scripts/check-dotconfig.py .config configs/${DEFCONFIG_NAME}
  33. artifacts:
  34. when: on_failure
  35. expire_in: 2 weeks
  36. paths:
  37. - .config
  38. .run_make: &run_make
  39. |
  40. make O=${OUTPUT_DIR} > >(tee build.log |grep '>>>') 2>&1 || {
  41. echo 'Failed build last output'
  42. tail -200 build.log
  43. exit 1
  44. }
  45. .defconfig_base:
  46. stage: test
  47. script:
  48. - DEFCONFIG_NAME=${CI_JOB_NAME}
  49. - OUTPUT_DIR=output
  50. - echo "Configure Buildroot for ${DEFCONFIG_NAME}"
  51. - make ${DEFCONFIG_NAME}
  52. - ./support/scripts/check-dotconfig.py .config ./configs/${DEFCONFIG_NAME}
  53. - echo 'Build buildroot'
  54. - *run_make
  55. - |
  56. ./support/scripts/boot-qemu-image.py "${DEFCONFIG_NAME}" > >(tee runtime-test.log) 2>&1 || {
  57. echo 'Failed runtime test last output'
  58. tail -200 runtime-test.log
  59. exit 1
  60. }
  61. retry:
  62. max: 2
  63. when:
  64. - runner_system_failure
  65. - stuck_or_timeout_failure
  66. artifacts:
  67. when: always
  68. expire_in: 2 weeks
  69. paths:
  70. - .config
  71. - build.log
  72. - output/images/
  73. - output/build/build-time.log
  74. - output/build/packages-file-list.txt
  75. - output/build/*/.config
  76. - runtime-test.log
  77. .runtime_test_download:
  78. stage: download
  79. # Keep test-dl directory so the downloaded files can be an artifact of
  80. # the job passed to all jobs of next stages.
  81. script: ./support/testing/run-tests -d test-dl/ --prepare-only
  82. artifacts:
  83. when: always
  84. paths:
  85. - test-dl/
  86. .runtime_test_base:
  87. stage: test
  88. # Keep build directories so the rootfs can be an artifact of the job. The
  89. # runner will clean up those files for us.
  90. # Multiply every emulator timeout by 10 to avoid sporadic failures in
  91. # elastic runners.
  92. script:
  93. - TEST_CASE_NAME=${CI_JOB_NAME}
  94. - echo "Starting runtime test ${TEST_CASE_NAME}"
  95. - |
  96. ./support/testing/run-tests -o test-output/ -d test-dl/ -k --timeout-multiplier 10 ${TEST_CASE_NAME} || {
  97. echo 'Failed runtime test last output'
  98. if [ -f test-output/*-run.log ]; then
  99. tail -200 test-output/*-run.log | sed 's/\r\r$//'
  100. else
  101. tail -200 test-output/*-build.log
  102. fi
  103. exit 1
  104. }
  105. retry:
  106. max: 2
  107. when:
  108. - runner_system_failure
  109. - stuck_or_timeout_failure
  110. artifacts:
  111. when: always
  112. expire_in: 2 weeks
  113. paths:
  114. - test-output/*.log
  115. - test-output/*/.config
  116. - test-output/*/images/*
  117. .test_pkg:
  118. stage: test
  119. script:
  120. - OUTPUT_DIR=${CI_JOB_NAME}
  121. - echo "Configure Buildroot for ${OUTPUT_DIR}"
  122. - make O=${OUTPUT_DIR} syncconfig
  123. - make O=${OUTPUT_DIR} savedefconfig
  124. - echo 'Build buildroot'
  125. - *run_make
  126. needs:
  127. - pipeline: $PARENT_PIPELINE_ID
  128. job: generate-gitlab-ci-yml
  129. retry:
  130. max: 2
  131. when:
  132. - runner_system_failure
  133. - stuck_or_timeout_failure
  134. artifacts:
  135. when: always
  136. expire_in: 2 weeks
  137. paths:
  138. - build.log
  139. - br-test-pkg/*/.config
  140. - br-test-pkg/*/defconfig
  141. - br-test-pkg/*/build/build-time.log
  142. - br-test-pkg/*/build/packages-file-list*.txt