Another attempt at fixing the Cypress job (#3749)

This commit is contained in:
Richard van der Hoff
2023-09-25 16:58:38 +02:00
committed by GitHub
parent 6385c9c0da
commit 37e1fd9af5
3 changed files with 30 additions and 32 deletions
-29
View File
@@ -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"
+28
View File
@@ -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 }}"
+2 -3
View File
@@ -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.
#