.gitlab-ci.yml.in 4.2 KB

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