@@ -87,15 +87,15 @@ aliases:
8787 cat ${HOME}/project/.circleci/scripts/enable-vnc.sh >> ~/.bashrc
8888 fi
8989
90- # Check if MMI tests should run
91- - &check-mmi-trigger
92- name : Check if MMI tests should run
90+ # Check if MMI Optional tests should run
91+ - &check-mmi-optional
92+ name : Check if MMI Optional tests should run
9393 command : |
94- source mmi_trigger.env
95- if [ "${run_mmi_tests }" == "true" ]; then
96- echo "Running MMI tests"
94+ RUN_MMI_OPTIONAL=$(cat ./RUN_MMI_OPTIONAL)
95+ if [[ "${RUN_MMI_OPTIONAL }" == "true" ] ]; then
96+ echo "Running MMI Optional tests"
9797 else
98- echo "Skipping MMI tests"
98+ echo "Skipping MMI Optional tests"
9999 circleci step halt
100100 fi
101101
@@ -114,7 +114,7 @@ workflows:
114114 - trigger-beta-build :
115115 requires :
116116 - prep-deps
117- - check-mmi-trigger
117+ - check-pr-tag
118118 - prep-deps
119119 - get-changed-files-with-git-diff :
120120 filters :
@@ -179,7 +179,7 @@ workflows:
179179 - prep-build-test-mmi-playwright :
180180 requires :
181181 - prep-deps
182- - check-mmi-trigger
182+ - check-pr-tag
183183 - prep-build-storybook :
184184 requires :
185185 - prep-deps
@@ -231,7 +231,7 @@ workflows:
231231 requires :
232232 - prep-build-test-mmi
233233 - get-changed-files-with-git-diff
234- - test-e2e-mmi-playwright :
234+ - test-e2e-mmi-playwright - OPTIONAL :
235235 requires :
236236 - prep-build-test-mmi-playwright
237237 - test-e2e-chrome-rpc-mmi :
@@ -421,6 +421,39 @@ jobs:
421421 name : Create GitHub Pull Request for version
422422 command : .circleci/scripts/release-create-release-pr.sh
423423
424+ check-pr-tag :
425+ docker :
426+ - image : cimg/base:stable
427+ steps :
428+ - run :
429+ name : Check for MMI Team Tag
430+ command : |
431+ #!/bin/bash
432+
433+ GH_LABEL=team-mmi
434+ if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
435+ echo "Skipping tag check; this is not a PR."
436+ echo "false" > ./RUN_MMI_OPTIONAL
437+ exit 0
438+ fi
439+
440+ echo $CIRCLE_PULL_REQUESTS | sed 's/,/\n/g'
441+
442+ # See if any associated PRs have matching label
443+ HAS_MATCHING_PR=$(echo $CIRCLE_PULL_REQUESTS \
444+ | sed -e 's#,#\n#g' -e 's#/github.com/#/api.github.com/repos/#g' -e 's#/pull/#/pulls/#g' \
445+ | xargs -n1 curl -s \
446+ | jq -s "map((.labels|map(select(.name==\"${GH_LABEL}\"))))|flatten|length > 0")
447+
448+ echo "${GH_LABEL} tag presence: ${HAS_MATCHING_PR}"
449+
450+ # assign the RUN_MMI_OPTIONAL variable
451+ echo "${HAS_MATCHING_PR}" > ./RUN_MMI_OPTIONAL
452+ - persist_to_workspace :
453+ root : .
454+ paths :
455+ - RUN_MMI_OPTIONAL
456+
424457 prep-deps :
425458 executor : node-browsers-medium
426459 steps :
@@ -806,7 +839,7 @@ jobs:
806839 - run : corepack enable
807840 - attach_workspace :
808841 at : .
809- - run : *check-mmi-trigger
842+ - run : *check-mmi-optional
810843 - run :
811844 name : Build MMI extension for Playwright e2e
812845 command : |
@@ -821,6 +854,7 @@ jobs:
821854 - persist_to_workspace :
822855 root : .
823856 paths :
857+ - RUN_MMI_OPTIONAL
824858 - dist-test-mmi-playwright
825859 - builds-test-mmi-playwright
826860 - store_artifacts :
@@ -1272,15 +1306,15 @@ jobs:
12721306 - store_test_results :
12731307 path : test/test-results/e2e
12741308
1275- test-e2e-mmi-playwright :
1309+ test-e2e-mmi-playwright - OPTIONAL :
12761310 executor : playwright
12771311 parallelism : 2
12781312 steps :
12791313 - run : *shallow-git-clone-and-enable-vnc
12801314 - run : corepack enable
12811315 - attach_workspace :
12821316 at : .
1283- - run : *check-mmi-trigger
1317+ - run : *check-mmi-optional
12841318 - run :
12851319 name : Move test build to dist
12861320 command : mv ./dist-test-mmi-playwright ./dist
@@ -1709,18 +1743,3 @@ jobs:
17091743 - run :
17101744 name : All Tests Passed
17111745 command : echo 'whew - everything passed!'
1712-
1713- check-mmi-trigger :
1714- executor : node-browsers-medium
1715- steps :
1716- - checkout
1717- - run :
1718- name : Check for MMI Team Label or Reviewer
1719- command : ./.circleci/scripts/check_mmi_trigger.sh
1720- - store_artifacts :
1721- path : mmi_trigger.env
1722- destination : mmi_trigger.env
1723- - persist_to_workspace :
1724- root : .
1725- paths :
1726- - mmi_trigger.env
0 commit comments