rules.yml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. # if anchors
  2. .if-ref-master: &if-ref-master
  3. if: '$CI_COMMIT_REF_NAME == "master"'
  4. .if-tag-release-no_label: &if-tag-release-no_label
  5. if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/ && $BOT_TRIGGER_WITH_LABEL == null'
  6. .if-protected: &if-protected
  7. if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
  8. .if-protected-no_label: &if-protected-no_label
  9. if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
  10. .if-dev-push: &if-dev-push
  11. if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
  12. .if-schedule: &if-schedule
  13. if: '$CI_PIPELINE_SOURCE == "schedule"'
  14. .if-trigger: &if-trigger
  15. if: '$CI_PIPELINE_SOURCE == "trigger"'
  16. .if-label-regular_test: &if-label-regular_test
  17. if: '$BOT_LABEL_REGULAR_TEST'
  18. .if-label-build: &if-label-build
  19. if: '$BOT_LABEL_BUILD'
  20. .if-label-build_docs: &if-label-build_docs
  21. if: '$BOT_LABEL_BUILD_DOCS'
  22. .if-label-integration_test: &if-label-integration_test
  23. if: '$BOT_LABEL_INTEGRATION_TEST'
  24. .if-label-unit_test: &if-label-unit_test
  25. if: '$BOT_LABEL_UNIT_TEST'
  26. .if-label-unit_test-32: &if-label-unit_test-32
  27. if: '$BOT_LABEL_UNIT_TEST_32'
  28. .if-label-unit_test-s2: &if-label-unit_test-s2
  29. if: '$BOT_LABEL_UNIT_TEST_S2'
  30. .if-label-unit_test-all_labels: &if-label-unit_test-all_labels
  31. if: '$BOT_LABEL_UNIT_TEST || $BOT_LABEL_UNIT_TEST_32 || $BOT_LABEL_UNIT_TEST_S2'
  32. .if-label-weekend_test: &if-label-weekend_test
  33. if: '$BOT_LABEL_WEEKEND_TEST'
  34. .if-label-example_test: &if-label-example_test
  35. if: '$BOT_LABEL_EXAMPLE_TEST'
  36. .if-label-custom_test: &if-label-custom_test
  37. if: '$BOT_LABEL_CUSTOM_TEST'
  38. .if-label-host_test: &if-label-host_test
  39. if: '$BOT_LABEL_HOST_TEST'
  40. .if-label-fuzzer_test: &if-label-fuzzer_test
  41. if: '$BOT_LABEL_FUZZER_TEST'
  42. .if-label-nvs_coverage: &if-label-nvs_coverage
  43. if: '$BOT_LABEL_NVS_COVERAGE'
  44. .if-label-static_analysis: &if-label-static_analysis
  45. if: '$BOT_LABEL_STATIC_ANALYSIS || $BOT_LABEL_STATIC_ANALYSIS_ALL'
  46. .if-label-iperf_stress_test: &if-label-iperf_stress_test
  47. if: '$BOT_LABEL_IPERF_STRESS_TEST'
  48. .if-os-mac: &if-os-mac
  49. if: '$BOT_LABEL_MACOS_TEST'
  50. # Rules templates
  51. .rules:protected:
  52. rules:
  53. - <<: *if-protected
  54. .rules:protected-no_label:
  55. rules:
  56. - <<: *if-protected-no_label
  57. .rules:protected-schedule:
  58. rules:
  59. - <<: *if-protected
  60. - <<: *if-schedule
  61. .rules:trigger:
  62. rules:
  63. - <<: *if-trigger
  64. .rules:dev:
  65. rules:
  66. - <<: *if-trigger
  67. - <<: *if-dev-push
  68. .rules:os:mac_os:
  69. rules:
  70. - <<: *if-protected-no_label
  71. - <<: *if-os-mac
  72. .rules:tag:release-no_label:
  73. rules:
  74. - <<: *if-tag-release-no_label
  75. .rules:ref:master-schedule:
  76. rules:
  77. - <<: *if-ref-master
  78. - <<: *if-schedule
  79. .rules:ref:master-schedule-always:
  80. rules:
  81. - <<: *if-ref-master
  82. when: always
  83. - <<: *if-schedule
  84. when: always
  85. .rules:labels:static_analysis-only:
  86. rules:
  87. - <<: *if-label-static_analysis
  88. .rules:labels:build:
  89. rules:
  90. - <<: *if-protected-no_label
  91. - <<: *if-label-regular_test
  92. - <<: *if-label-build
  93. .rules:labels:build_docs:
  94. rules:
  95. - <<: *if-protected-no_label
  96. - <<: *if-label-build
  97. - <<: *if-label-regular_test
  98. - <<: *if-label-build_docs
  99. .rules:labels:build_docs-slim:
  100. rules:
  101. - <<: *if-protected-no_label
  102. - <<: *if-label-build_docs
  103. .rules:labels:build_docs-preview:
  104. rules:
  105. - <<: *if-label-build_docs
  106. .rules:labels:weekend_test-only:
  107. rules:
  108. - <<: *if-label-weekend_test
  109. .rules:labels:iperf_stress_test-only:
  110. rules:
  111. - <<: *if-label-iperf_stress_test
  112. .rules:labels:fuzzer_test-weekend_test-only:
  113. rules:
  114. - <<: *if-label-fuzzer_test
  115. - <<: *if-label-weekend_test
  116. .rules:labels:nvs_coverage-only:
  117. rules:
  118. - <<: *if-label-nvs_coverage
  119. .rules:labels:host_test:
  120. rules:
  121. - <<: *if-protected-no_label
  122. - <<: *if-label-regular_test
  123. - <<: *if-label-host_test
  124. .rules:tests:example_test-schedule:
  125. rules:
  126. - <<: *if-protected-no_label
  127. - <<: *if-label-example_test
  128. - <<: *if-schedule
  129. .rules:tests:custom_test-schedule:
  130. rules:
  131. - <<: *if-protected-no_label
  132. - <<: *if-label-custom_test
  133. - <<: *if-schedule
  134. .rules:tests:unit_test:
  135. rules:
  136. - <<: *if-protected-no_label
  137. - <<: *if-label-unit_test-all_labels
  138. .rules:tests:unit_test_32:
  139. rules:
  140. - <<: *if-protected-no_label
  141. - <<: *if-label-unit_test
  142. - <<: *if-label-unit_test-32
  143. .rules:tests:unit_test_s2:
  144. rules:
  145. - <<: *if-protected-no_label
  146. - <<: *if-label-unit_test
  147. - <<: *if-label-unit_test-s2
  148. .rules:tests:integration_test:
  149. rules:
  150. - <<: *if-protected-no_label
  151. - <<: *if-label-integration_test
  152. .rules:assign_test:target_test-integration_test-weekend_test:
  153. rules:
  154. - <<: *if-protected-no_label
  155. - <<: *if-label-regular_test
  156. - <<: *if-label-example_test
  157. - <<: *if-label-custom_test
  158. - <<: *if-label-unit_test-all_labels
  159. - <<: *if-label-integration_test
  160. - <<: *if-label-weekend_test
  161. .rules:build_tests:integration_test:
  162. rules:
  163. - <<: *if-protected-no_label
  164. - <<: *if-label-build
  165. - <<: *if-label-regular_test
  166. - <<: *if-label-integration_test
  167. .rules:build_tests:weekend_test:
  168. rules:
  169. - <<: *if-protected-no_label
  170. - <<: *if-label-build
  171. - <<: *if-label-regular_test
  172. - <<: *if-label-weekend_test
  173. .rules:build_tests:unit_test:
  174. rules:
  175. - <<: *if-protected-no_label
  176. - <<: *if-label-build
  177. - <<: *if-label-regular_test
  178. - <<: *if-label-unit_test-all_labels
  179. .rules:build_tests:example_test-weekend_test:
  180. rules:
  181. - <<: *if-protected-no_label
  182. - <<: *if-label-build
  183. - <<: *if-label-regular_test
  184. - <<: *if-label-example_test
  185. - <<: *if-label-weekend_test
  186. .rules:build_tests:custom_test-weekend_test:
  187. rules:
  188. - <<: *if-protected-no_label
  189. - <<: *if-label-build
  190. - <<: *if-label-regular_test
  191. - <<: *if-label-custom_test
  192. - <<: *if-label-weekend_test
  193. .rules:build_tests:target_test:
  194. rules:
  195. - <<: *if-protected-no_label
  196. - <<: *if-label-build
  197. - <<: *if-label-regular_test
  198. - <<: *if-label-example_test
  199. - <<: *if-label-custom_test
  200. - <<: *if-label-unit_test-all_labels
  201. .rules:build_tests:target_test-weekend_test:
  202. rules:
  203. - <<: *if-protected-no_label
  204. - <<: *if-label-build
  205. - <<: *if-label-regular_test
  206. - <<: *if-label-example_test
  207. - <<: *if-label-custom_test
  208. - <<: *if-label-unit_test-all_labels
  209. - <<: *if-label-weekend_test