From 37e1fd9af5bba74f75ed5a0010ed77cf92ee5bc4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:58:38 +0200 Subject: [PATCH] Another attempt at fixing the Cypress job (#3749) --- .github/workflows/cypress-skipped.yml | 29 ---------------------- .github/workflows/cypress.yml | 28 +++++++++++++++++++++ .github/workflows/downstream-artifacts.yml | 5 ++-- 3 files changed, 30 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/cypress-skipped.yml diff --git a/.github/workflows/cypress-skipped.yml b/.github/workflows/cypress-skipped.yml deleted file mode 100644 index 4d803b3b5..000000000 --- a/.github/workflows/cypress-skipped.yml +++ /dev/null @@ -1,29 +0,0 @@ -# We only want to run the cypress tests in the merge queue (to save CI time), -# but we do want to make it a required check for the merge queue. -# -# Unfortunately, github doesn't distinguish between "checks needed for branch -# protection" (ie, the things that must pass before the PR will even be added -# to the merge queue) and "checks needed in the merge queue". We just have to add -# the check to the branch protection list. -# -# Ergo, if we know we're not going to run the cypress tests, we need to add a -# passing status check manually. - -name: Mark cypress skipped -on: - pull_request: {} -permissions: - statuses: write -jobs: - mark_skipped: - runs-on: ubuntu-latest - steps: - - uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6 - with: - authToken: "${{ secrets.GITHUB_TOKEN }}" - state: success - description: Cypress skipped - context: "matrix-react-sdk Cypress End to End Tests / cypress" - sha: "${{ github.event.pull_request.head.sha }}" - # link to this file - target_url: "${{ github.event.pull_request.head.repo.html_url }}/blob/${{ github.event.pull_request.head.ref }}/.github/workflows/cypress-skipped.yml" diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 88ddaaf2f..401e5c6a9 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -15,6 +15,11 @@ concurrency: jobs: cypress: name: Cypress + + # We only want to run the cypress tests on merge queue to prevent regressions + # from creeping in. They take a long time to run and consume 4 concurrent runners. + if: github.event.workflow_run.event == 'merge_group' + uses: matrix-org/matrix-react-sdk/.github/workflows/cypress.yaml@v3.80.1 permissions: actions: read @@ -29,3 +34,26 @@ jobs: with: react-sdk-repository: matrix-org/matrix-react-sdk rust-crypto: true + + # We want to make the cypress tests a required check for the merge queue. + # + # Unfortunately, github doesn't distinguish between "checks needed for branch + # protection" (ie, the things that must pass before the PR will even be added + # to the merge queue) and "checks needed in the merge queue". We just have to add + # the check to the branch protection list. + # + # Ergo, if we know we're not going to run the cypress tests, we need to add a + # passing status check manually. + mark_skipped: + if: github.event.workflow_run.event != 'merge_group' + permissions: + statuses: write + runs-on: ubuntu-latest + steps: + - uses: Sibz/github-status-action@650dd1a882a76dbbbc4576fb5974b8d22f29847f # v1.1.6 + with: + authToken: "${{ secrets.GITHUB_TOKEN }}" + state: success + description: Cypress skipped + context: "${ github.workflow }} / cypress" + sha: "${{ github.event.workflow_run.head_sha }}" diff --git a/.github/workflows/downstream-artifacts.yml b/.github/workflows/downstream-artifacts.yml index 6413d0141..2537eec40 100644 --- a/.github/workflows/downstream-artifacts.yml +++ b/.github/workflows/downstream-artifacts.yml @@ -1,11 +1,10 @@ name: Build downstream artifacts on: - # We only want the Rust Crypto Cypress tests on merge queue to prevent regressions - # from creeping in. They take a long time to run and consume 4 concurrent runners. - # Anyone working on Rust Crypto is able to run the tests locally if required. merge_group: types: [checks_requested] + pull_request: {} + # For now at least, we don't run this or the cypress-tests against pushes # to develop or master. #