From 8f2af54fb8abcf75a7bf6444c3315859a5ef4b6a Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Mon, 12 Feb 2024 15:48:06 -0800 Subject: [PATCH 1/5] Check integration test for presubmit instruction Adds a new presubmit instruction who presence tells us to skip the integration test so that it's failure is not blocking. --- .github/workflows/integration_tests.yml | 40 ++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 0a925f61..dd86ee1a 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -9,10 +9,48 @@ on: jobs: + grab-pr-body: + runs-on: ubuntu-latest + outputs: + PR_BODY: ${{ steps.body.outputs.PR_BODY }} + steps: + - id: body + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + { + echo "PR_BODY<> "$GITHUB_OUTPUT" + + check-pr-body-for-key: + runs-on: ubuntu-latest + needs: grab-pr-body + outputs: + RUN_INTEGRATION: ${{ steps.check_key.outputs.RUN_INTEGRATION }} + steps: + - id: check_key + env: + PR_BODY: ${{ needs.grab-pr-body.outputs.PR_BODY }} + SKIP_KEY: "SKIP_INTEGRATION_TESTS=YES" + name: Check for key and set bool to skip integration tests + run: | + if [[ "$PR_BODY" == *"$SKIP_KEY"* ]]; then + echo "Skipping integration tests for PR body:" + echo "$PR_BODY" + echo "RUN_INTEGRATION=no" >> "$GITHUB_OUTPUT" + else + echo "Running integration tests for PR body:" + echo "$PR_BODY" + echo "RUN_INTEGRATION=yes" >> "$GITHUB_OUTPUT" + fi + swift-button-functional-test: runs-on: macOS-12 + needs: check-pr-body-for-key # Don't run if triggered by a PR from a fork since our Secrets won't be provided to the runner. - if: false # Disabled per issue 367; add back here check for PRs from forks + if: ${{ needs.check-pr-body-for-key.outputs.RUN_INTEGRATION == 'yes' }} && "!github.event.pull_request.head.repo.fork" defaults: run: working-directory: Samples/Swift/DaysUntilBirthday From 72e4bb4ab0fb1bc4dbf0e415fecdc5686cd707a8 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 23 Feb 2024 15:22:23 -0800 Subject: [PATCH 2/5] Test skip integration tests From e36c784323ad059b84bbaa484e64a178287a85d3 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 23 Feb 2024 15:24:10 -0800 Subject: [PATCH 3/5] Test skip integration tests The previous commit should not skip, but this one should because the body has updated the skip key to YES. From cbb9c391075f929fbaa64f3b09455f31d8cd8731 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Fri, 23 Feb 2024 17:22:37 -0800 Subject: [PATCH 4/5] Skip integration tests From 751d837787a6e322a3a4626722bbb4fb94cb5269 Mon Sep 17 00:00:00 2001 From: Matthew Mathias Date: Wed, 28 Feb 2024 10:54:22 -0800 Subject: [PATCH 5/5] Empty commit to test skipping