From 3522402e9d607dfa4800d0d25ec213fad81ad77f Mon Sep 17 00:00:00 2001 From: Oliver Barnwell Date: Thu, 21 Sep 2023 16:41:46 +0100 Subject: [PATCH 1/2] remove external contrib pr_target check --- .github/workflows/cypress-e2e-chrome.yml | 32 +++-------------------- .github/workflows/cypress-e2e-firefox.yml | 30 ++------------------- 2 files changed, 5 insertions(+), 57 deletions(-) diff --git a/.github/workflows/cypress-e2e-chrome.yml b/.github/workflows/cypress-e2e-chrome.yml index 9e2b74b73..09ee0229d 100644 --- a/.github/workflows/cypress-e2e-chrome.yml +++ b/.github/workflows/cypress-e2e-chrome.yml @@ -4,38 +4,12 @@ on: branches: - main pull_request: - pull_request_target: - types: - - labeled jobs: - label_check: - runs-on: ubuntu-latest - outputs: - authorized: ${{ steps.label_check.outputs.authorized }} - steps: - - name: Check if authorized label is present - id: label_check - run: | - LABEL_NAME="CI Approved" - PR_LABELS=$(jq '.pull_request.labels[].name' $GITHUB_EVENT_PATH | tr '\n' ' ') - if [[ ${PR_LABELS} =~ ${LABEL_NAME} ]]; then - echo "Authorized label found." - echo "::set-output name=authorized::true" - else - echo "Authorized label not found." - echo "::set-output name=authorized::false" - fi - cypress-e2e-chrome: name: Cypress E2E Chrome - runs-on: ubuntu-20.04 - # Don't run the e2e tests for dependabot prs or if the PR is not labeled as 'safe to test'. - if: | - ${{ github.event.pull_request.user.login == 'dependabot[bot]' && - needs.label_check.outputs.authorized == 'true' }} - - # Only run the e2e tests if a maintainer has labeled the PR as 'safe to test'. - needs: [label_check] + runs-on: ubuntu-latest + # Don't run the e2e tests for dependabot prs. + if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} timeout-minutes: 15 strategy: # when one test fails, DO NOT cancel the other diff --git a/.github/workflows/cypress-e2e-firefox.yml b/.github/workflows/cypress-e2e-firefox.yml index 2043c1dff..37f10a073 100644 --- a/.github/workflows/cypress-e2e-firefox.yml +++ b/.github/workflows/cypress-e2e-firefox.yml @@ -4,38 +4,12 @@ on: branches: - main pull_request: - pull_request_target: - types: - - labeled jobs: - label_check: - runs-on: ubuntu-latest - outputs: - authorized: ${{ steps.label_check.outputs.authorized }} - steps: - - name: Check if authorized label is present - id: label_check - run: | - LABEL_NAME="CI Approved" - PR_LABELS=$(jq '.pull_request.labels[].name' $GITHUB_EVENT_PATH | tr '\n' ' ') - if [[ ${PR_LABELS} =~ ${LABEL_NAME} ]]; then - echo "Authorized label found." - echo "::set-output name=authorized::true" - else - echo "Authorized label not found." - echo "::set-output name=authorized::false" - fi - cypress-e2e-firefox: name: Cypress E2E Firefox - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest # Don't run the e2e tests for dependabot prs or if the PR is not labeled as 'safe to test'. - if: | - ${{ github.event.pull_request.user.login == 'dependabot[bot]' && - needs.label_check.outputs.authorized == 'true' }} - - # Only run the e2e tests if a maintainer has labeled the PR as 'safe to test'. - needs: [label_check] + if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }} timeout-minutes: 15 strategy: # when one test fails, DO NOT cancel the other From 4d8465239c4891247e0c4d09a12acf52f39e8143 Mon Sep 17 00:00:00 2001 From: Oliver Barnwell Date: Thu, 21 Sep 2023 22:24:07 +0100 Subject: [PATCH 2/2] try something new --- cypress.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cypress.config.ts b/cypress.config.ts index 02f4e853b..e50b8bea5 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -51,6 +51,13 @@ export default defineConfig({ return launchOptions; } + if (browser.name === 'chrome' && browser.isHeadless) { + const headlessIndex = launchOptions.args.indexOf('--headless'); + if (headlessIndex > -1) { + launchOptions.args[headlessIndex] = '--headless=new'; + } + } + // whatever you return here becomes the launchOptions return launchOptions; });