rules.yml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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-c3: &if-label-unit_test-c3
  31. if: '$BOT_LABEL_UNIT_TEST_C3'
  32. .if-label-unit_test-all_labels: &if-label-unit_test-all_labels
  33. if: '$BOT_LABEL_UNIT_TEST || $BOT_LABEL_UNIT_TEST_32 || $BOT_LABEL_UNIT_TEST_S2 || $BOT_LABEL_UNIT_TEST_C3'
  34. .if-label-weekend_test: &if-label-weekend_test
  35. if: '$BOT_LABEL_WEEKEND_TEST'
  36. .if-label-example_test: &if-label-example_test
  37. if: '$BOT_LABEL_EXAMPLE_TEST'
  38. .if-label-custom_test: &if-label-custom_test
  39. if: '$BOT_LABEL_CUSTOM_TEST'
  40. .if-label-host_test: &if-label-host_test
  41. if: '$BOT_LABEL_HOST_TEST'
  42. .if-label-fuzzer_test: &if-label-fuzzer_test
  43. if: '$BOT_LABEL_FUZZER_TEST'
  44. .if-label-nvs_coverage: &if-label-nvs_coverage
  45. if: '$BOT_LABEL_NVS_COVERAGE'
  46. .if-label-static_analysis: &if-label-static_analysis
  47. if: '$BOT_LABEL_STATIC_ANALYSIS || $BOT_LABEL_STATIC_ANALYSIS_ALL'
  48. .if-label-iperf_stress_test: &if-label-iperf_stress_test
  49. if: '$BOT_LABEL_IPERF_STRESS_TEST'
  50. .if-os-mac: &if-os-mac
  51. if: '$BOT_LABEL_MACOS_TEST'
  52. # Rules templates
  53. .rules:protected:
  54. rules:
  55. - <<: *if-protected
  56. .rules:protected-no_label:
  57. rules:
  58. - <<: *if-protected-no_label
  59. .rules:protected-schedule:
  60. rules:
  61. - <<: *if-protected
  62. - <<: *if-schedule
  63. .rules:trigger:
  64. rules:
  65. - <<: *if-trigger
  66. .rules:dev:
  67. rules:
  68. - <<: *if-trigger
  69. - <<: *if-dev-push
  70. .rules:os:mac_os:
  71. rules:
  72. - <<: *if-protected-no_label
  73. - <<: *if-os-mac
  74. .rules:tag:release-no_label:
  75. rules:
  76. - <<: *if-tag-release-no_label
  77. .rules:ref:master-schedule:
  78. rules:
  79. - <<: *if-ref-master
  80. - <<: *if-schedule
  81. .rules:ref:master-schedule-always:
  82. rules:
  83. - <<: *if-ref-master
  84. when: always
  85. - <<: *if-schedule
  86. when: always
  87. .rules:labels:static_analysis-only:
  88. rules:
  89. - <<: *if-label-static_analysis
  90. .rules:labels:build:
  91. rules:
  92. - <<: *if-protected-no_label
  93. - <<: *if-label-regular_test
  94. - <<: *if-label-build
  95. .rules:labels:build_docs:
  96. rules:
  97. - <<: *if-protected-no_label
  98. - <<: *if-label-build
  99. - <<: *if-label-regular_test
  100. - <<: *if-label-build_docs
  101. .rules:labels:build_docs-slim:
  102. rules:
  103. - <<: *if-protected-no_label
  104. - <<: *if-label-build_docs
  105. .rules:labels:build_docs-preview:
  106. rules:
  107. - <<: *if-label-build_docs
  108. .rules:labels:weekend_test-only:
  109. rules:
  110. - <<: *if-label-weekend_test
  111. .rules:labels:iperf_stress_test-only:
  112. rules:
  113. - <<: *if-label-iperf_stress_test
  114. .rules:labels:fuzzer_test-weekend_test-only:
  115. rules:
  116. - <<: *if-label-fuzzer_test
  117. - <<: *if-label-weekend_test
  118. .rules:labels:nvs_coverage-only:
  119. rules:
  120. - <<: *if-label-nvs_coverage
  121. .rules:labels:host_test:
  122. rules:
  123. - <<: *if-protected-no_label
  124. - <<: *if-label-regular_test
  125. - <<: *if-label-host_test
  126. .rules:tests:example_test-schedule:
  127. rules:
  128. - <<: *if-protected-no_label
  129. - <<: *if-label-example_test
  130. - <<: *if-schedule
  131. .rules:tests:custom_test-schedule:
  132. rules:
  133. - <<: *if-protected-no_label
  134. - <<: *if-label-custom_test
  135. - <<: *if-schedule
  136. .rules:tests:unit_test:
  137. rules:
  138. - <<: *if-protected-no_label
  139. - <<: *if-label-unit_test-all_labels
  140. .rules:tests:unit_test_32:
  141. rules:
  142. - <<: *if-protected-no_label
  143. - <<: *if-label-unit_test
  144. - <<: *if-label-unit_test-32
  145. .rules:tests:unit_test_s2:
  146. rules:
  147. - <<: *if-protected-no_label
  148. - <<: *if-label-unit_test
  149. - <<: *if-label-unit_test-s2
  150. .rules:tests:unit_test_c3:
  151. rules:
  152. - <<: *if-protected-no_label
  153. - <<: *if-label-unit_test
  154. - <<: *if-label-unit_test-c3
  155. .rules:tests:integration_test:
  156. rules:
  157. - <<: *if-protected-no_label
  158. - <<: *if-label-integration_test
  159. .rules:assign_test:target_test-integration_test-weekend_test:
  160. rules:
  161. - <<: *if-protected-no_label
  162. - <<: *if-label-regular_test
  163. - <<: *if-label-example_test
  164. - <<: *if-label-custom_test
  165. - <<: *if-label-unit_test-all_labels
  166. - <<: *if-label-integration_test
  167. - <<: *if-label-weekend_test
  168. .rules:build_tests:integration_test:
  169. rules:
  170. - <<: *if-protected-no_label
  171. - <<: *if-label-build
  172. - <<: *if-label-regular_test
  173. - <<: *if-label-integration_test
  174. .rules:build_tests:weekend_test:
  175. rules:
  176. - <<: *if-protected-no_label
  177. - <<: *if-label-build
  178. - <<: *if-label-regular_test
  179. - <<: *if-label-weekend_test
  180. .rules:build_tests:unit_test:
  181. rules:
  182. - <<: *if-protected-no_label
  183. - <<: *if-label-build
  184. - <<: *if-label-regular_test
  185. - <<: *if-label-unit_test-all_labels
  186. .rules:build_tests:example_test-weekend_test:
  187. rules:
  188. - <<: *if-protected-no_label
  189. - <<: *if-label-build
  190. - <<: *if-label-regular_test
  191. - <<: *if-label-example_test
  192. - <<: *if-label-weekend_test
  193. .rules:build_tests:custom_test-weekend_test:
  194. rules:
  195. - <<: *if-protected-no_label
  196. - <<: *if-label-build
  197. - <<: *if-label-regular_test
  198. - <<: *if-label-custom_test
  199. - <<: *if-label-weekend_test
  200. .rules:build_tests:target_test:
  201. rules:
  202. - <<: *if-protected-no_label
  203. - <<: *if-label-build
  204. - <<: *if-label-regular_test
  205. - <<: *if-label-example_test
  206. - <<: *if-label-custom_test
  207. - <<: *if-label-unit_test-all_labels
  208. .rules:build_tests:target_test-weekend_test:
  209. rules:
  210. - <<: *if-protected-no_label
  211. - <<: *if-label-build
  212. - <<: *if-label-regular_test
  213. - <<: *if-label-example_test
  214. - <<: *if-label-custom_test
  215. - <<: *if-label-unit_test-all_labels
  216. - <<: *if-label-weekend_test