.gitlab-ci.yml.in 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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:20180318.1724
  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. artifacts:
  51. when: always
  52. expire_in: 2 weeks
  53. paths:
  54. - .config
  55. - build.log
  56. - output/images/
  57. - output/build/build-time.log
  58. - output/build/packages-file-list.txt
  59. - output/build/*/.config
  60. .defconfig:
  61. extends: .defconfig_base
  62. # Running the defconfigs for every push is too much, so limit to
  63. # explicit triggers through the API.
  64. only:
  65. - triggers
  66. - tags
  67. - /-defconfigs$/
  68. before_script:
  69. - DEFCONFIG_NAME=${CI_JOB_NAME}
  70. one-defconfig:
  71. extends: .defconfig_base
  72. only:
  73. - /^.*-.*_defconfig$/
  74. before_script:
  75. - DEFCONFIG_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')
  76. .runtime_test_base:
  77. # Keep build directories so the rootfs can be an artifact of the job. The
  78. # runner will clean up those files for us.
  79. # Multiply every emulator timeout by 10 to avoid sporadic failures in
  80. # elastic runners.
  81. script:
  82. - echo "Starting runtime test ${TEST_CASE_NAME}"
  83. - ./support/testing/run-tests -o test-output/ -d test-dl/ -k --timeout-multiplier 10 ${TEST_CASE_NAME}
  84. artifacts:
  85. when: always
  86. expire_in: 2 weeks
  87. paths:
  88. - test-output/*.log
  89. - test-output/*/.config
  90. - test-output/*/images/*
  91. .runtime_test:
  92. extends: .runtime_test_base
  93. # Running the runtime tests for every push is too much, so limit to
  94. # explicit triggers through the API.
  95. only:
  96. - triggers
  97. - tags
  98. - /-runtime-tests$/
  99. before_script:
  100. - TEST_CASE_NAME=${CI_JOB_NAME}
  101. one-runtime_test:
  102. extends: .runtime_test_base
  103. only:
  104. - /^.*-tests\..*$/
  105. before_script:
  106. - TEST_CASE_NAME=$(echo ${CI_COMMIT_REF_NAME} | sed -e 's,^.*-,,g')