From 99d2737f9ad310f9ecdbefac6be03922efadd6f3 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Mon, 29 Jan 2024 13:39:04 -0800 Subject: [PATCH 1/2] Fix percy workflow Wrong script name, handle it. --- .github/workflows/percy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/percy.yml b/.github/workflows/percy.yml index 8df6f2268..c81c4919d 100644 --- a/.github/workflows/percy.yml +++ b/.github/workflows/percy.yml @@ -37,7 +37,7 @@ jobs: cache: pnpm - run: pnpm install - name: Run Percy Tests - run: pnpm run --workspace-concurrency=1 -r percy + run: pnpm run --workspace-concurrency=1 -r test:percy - uses: act10ns/slack@v2 if: failure() with: From 412709cc45129891c65f7680791a0814e08983ec Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Tue, 30 Jan 2024 07:58:51 -0800 Subject: [PATCH 2/2] Split percy tests None of the non PR run types were actually running because of the test for a label and the PR tests were running on HEAD because this is a pull_request_target workflow. For now I split them into two workflows. --- .github/workflows/percy-test-pr.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/percy.yml | 6 ----- 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/percy-test-pr.yml diff --git a/.github/workflows/percy-test-pr.yml b/.github/workflows/percy-test-pr.yml new file mode 100644 index 000000000..808fffab8 --- /dev/null +++ b/.github/workflows/percy-test-pr.yml @@ -0,0 +1,41 @@ +name: Percy PR Tests + +on: + pull_request_target: + types: [labeled,opened,reopened,synchronize] + +concurrency: + group: percy-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +env: + SW_DISABLED: true + COVERAGE: false + PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }} + +jobs: + percy: + name: Test and Capture Screenshots + if: contains(github.event.pull_request.labels.*.name, 'run percy tests') + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ github.event.pull_request.merge_commit_sha }}" + - uses: pnpm/action-setup@v2 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: pnpm + - run: pnpm install + - name: Run Percy Tests + run: pnpm run --workspace-concurrency=1 -r test:percy + - uses: act10ns/slack@v2 + if: failure() + with: + status: ${{ job.status }} + message: Percy Run Failed {{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }} diff --git a/.github/workflows/percy.yml b/.github/workflows/percy.yml index c81c4919d..01facd1bc 100644 --- a/.github/workflows/percy.yml +++ b/.github/workflows/percy.yml @@ -1,11 +1,6 @@ name: Percy Visual Tests on: - push: - tags: - - '*' - pull_request_target: - types: [labeled,opened,reopened,synchronize] schedule: - cron: "15 23 * * 2,4" # T,Th in the afternoon (UTC) workflow_dispatch: @@ -23,7 +18,6 @@ env: jobs: percy: name: Test and Capture Screenshots - if: contains(github.event.pull_request.labels.*.name, 'run percy tests') runs-on: ubuntu-latest timeout-minutes: 20 steps: