.gitlab-ci.yml.in 4.5 KB

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