gitlab-ci.yml.in 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # Configuration for Gitlab-CI.
  2. # Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines
  3. image: buildroot/base:20200814.2228
  4. .check_base:
  5. rules:
  6. - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/ || $CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
  7. when: never
  8. - when: always
  9. check-DEVELOPERS:
  10. extends: .check_base
  11. # get-developers should print just "No action specified"; if it prints
  12. # anything else, it's a parse error.
  13. # The initial ! is removed by YAML so we need to quote it.
  14. script:
  15. - "! utils/get-developers | grep -v 'No action specified'"
  16. check-flake8:
  17. extends: .check_base
  18. before_script:
  19. # Help flake8 to find the Python files without .py extension.
  20. - find * -type f -name '*.py' > files.txt
  21. - find * -type f -print0 | xargs -0 file | grep 'Python script' | cut -d':' -f1 >> files.txt
  22. - sort -u files.txt | tee files.processed
  23. script:
  24. - python3 -m flake8 --statistics --count --max-line-length=132 $(cat files.processed)
  25. after_script:
  26. - wc -l files.processed
  27. check-package:
  28. extends: .check_base
  29. script:
  30. - make check-package
  31. .defconfig_check:
  32. script:
  33. - echo "Configure Buildroot for ${DEFCONFIG_NAME}"
  34. - make ${DEFCONFIG_NAME}
  35. - support/scripts/check-dotconfig.py .config configs/${DEFCONFIG_NAME}
  36. artifacts:
  37. when: on_failure
  38. expire_in: 2 weeks
  39. paths:
  40. - .config
  41. before_script:
  42. - DEFCONFIG_NAME=$(echo ${CI_JOB_NAME} | sed -e 's,_check$,,g')
  43. .defconfig_base:
  44. script:
  45. - echo "Configure Buildroot for ${DEFCONFIG_NAME}"
  46. - make ${DEFCONFIG_NAME}
  47. - ./support/scripts/check-dotconfig.py .config ./configs/${DEFCONFIG_NAME}
  48. - echo 'Build buildroot'
  49. - |
  50. make > >(tee build.log |grep '>>>') 2>&1 || {
  51. echo 'Failed build last output'
  52. tail -200 build.log
  53. exit 1
  54. }
  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. artifacts:
  62. when: always
  63. expire_in: 2 weeks
  64. paths:
  65. - .config
  66. - build.log
  67. - output/images/
  68. - output/build/build-time.log
  69. - output/build/packages-file-list.txt
  70. - output/build/*/.config
  71. - runtime-test.log
  72. .defconfig:
  73. extends: .defconfig_base
  74. # Running the defconfigs for every push is too much, so limit to
  75. # explicit triggers through the API.
  76. rules:
  77. # For tags, create a pipeline.
  78. - if: '$CI_COMMIT_TAG'
  79. # For pipeline created by using a trigger token.
  80. - if: '$CI_PIPELINE_TRIGGERED'
  81. # For the branch or tag name named *-defconfigs, create a pipeline.
  82. - if: '$CI_COMMIT_REF_NAME =~ /^.*-defconfigs$/'
  83. before_script:
  84. - DEFCONFIG_NAME=${CI_JOB_NAME}
  85. one-defconfig:
  86. extends: .defconfig_base
  87. rules:
  88. # For the branch or tag name named *-*_defconfigs, create a pipeline.
  89. - if: '$CI_COMMIT_REF_NAME =~ /^.*-.*_defconfig$/'
  90. before_script:
  91. - DEFCONFIG_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
  92. .runtime_test_base:
  93. # Keep build directories so the rootfs can be an artifact of the job. The
  94. # runner will clean up those files for us.
  95. # Multiply every emulator timeout by 10 to avoid sporadic failures in
  96. # elastic runners.
  97. script:
  98. - echo "Starting runtime test ${TEST_CASE_NAME}"
  99. - ./support/testing/run-tests -o test-output/ -d test-dl/ -k --timeout-multiplier 10 ${TEST_CASE_NAME}
  100. artifacts:
  101. when: always
  102. expire_in: 2 weeks
  103. paths:
  104. - test-output/*.log
  105. - test-output/*/.config
  106. - test-output/*/images/*
  107. .runtime_test:
  108. extends: .runtime_test_base
  109. # Running the runtime tests for every push is too much, so limit to
  110. # explicit triggers through the API.
  111. rules:
  112. # For tags, create a pipeline.
  113. - if: '$CI_COMMIT_TAG'
  114. # For pipeline created by using a trigger token.
  115. - if: '$CI_PIPELINE_TRIGGERED'
  116. # For the branch or tag name named *-runtime-tests, create a pipeline.
  117. - if: '$CI_COMMIT_REF_NAME =~ /^.*-runtime-tests$/'
  118. before_script:
  119. - TEST_CASE_NAME=${CI_JOB_NAME}
  120. one-runtime_test:
  121. extends: .runtime_test_base
  122. rules:
  123. - if: '$CI_COMMIT_REF_NAME =~ /^.*-tests\..*$/'
  124. before_script:
  125. - TEST_CASE_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')