.gitlab-ci.yml.in 3.8 KB

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