integration_test.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # generate dynamic integration pipeline by `idf-integration-ci` project
  2. .patterns-integration_test: &patterns-integration_test
  3. # add all possible patterns to make sure `gen_integration_pipeline` can be triggered.
  4. # fine-grained control will be done while generating the pipeline
  5. # find `patterns` in `idf-integration-ci` project
  6. - "components/**/*"
  7. - "tools/**/*"
  8. - ".gitlab-ci.yml"
  9. - ".gitlab/ci/common.yml"
  10. - ".gitlab/ci/integration_test.yml"
  11. - ".gitmodules"
  12. - "CMakeLists.txt"
  13. - "install.sh"
  14. - "export.sh"
  15. - "Kconfig"
  16. - "sdkconfig.rename"
  17. # Simplify the rules
  18. .integration_test_rules:
  19. rules:
  20. - if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
  21. - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
  22. changes: *patterns-integration_test
  23. # support trigger by ci labels
  24. - if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*target_test(?:,[^,\n\r]+)*$/i'
  25. - if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test(?:,[^,\n\r]+)*$/i'
  26. - if: '$CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build(?:,[^,\n\r]+)*$/i'
  27. gen_integration_pipeline:
  28. extends:
  29. - .before_script:minimal
  30. - .integration_test_rules
  31. image: ${CI_INTEGRATION_ASSIGN_ENV}
  32. stage: assign_test
  33. cache: []
  34. tags:
  35. - assign_test
  36. variables:
  37. SUBMODULES_TO_FETCH: "none"
  38. GIT_LFS_SKIP_SMUDGE: 1
  39. needs:
  40. - job: fast_template_app
  41. artifacts: false
  42. optional: true
  43. artifacts:
  44. paths:
  45. - idf-integration-ci/child_pipeline/
  46. expire_in: 2 weeks
  47. script:
  48. - add_gitlab_ssh_keys
  49. - retry_failed git clone ${CI_GEN_INTEGRATION_PIPELINE_REPO} idf-integration-ci
  50. - python $CHECKOUT_REF_SCRIPT idf-integration-ci idf-integration-ci
  51. - cd idf-integration-ci
  52. - python tools/generate_child_pipeline.py -o child_pipeline/
  53. child_integration_test_pipeline:
  54. extends:
  55. - .integration_test_rules
  56. stage: assign_test
  57. needs:
  58. - gen_integration_pipeline
  59. trigger:
  60. include:
  61. - artifact: idf-integration-ci/child_pipeline/pipeline.yml
  62. job: gen_integration_pipeline
  63. forward:
  64. yaml_variables: false
  65. strategy: depend