From 4f5dac6d96214d2fa7dd5b51ee57d4828498b355 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 5 Sep 2023 19:57:22 +0200 Subject: [PATCH] test(cypress): only run in parallel for pull requests Results from pushes are not time critical. Save some resources by avoiding the overhead of parallelization. Signed-off-by: Max --- .github/workflows/cypress.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 4634b76bfeb..7402f0cae3a 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -7,10 +7,11 @@ on: - main - master - stable* + - test/slow-cypress-on-push concurrency: group: ${{ github.head_ref || github.run_id }} - cancel-in-progress: true + cancel-in-progress: ${{ !github.head_ref }} env: APP_NAME: text @@ -60,12 +61,6 @@ jobs: - name: Set up npm ${{ steps.versions.outputs.npmVersion }} run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" - - name: Install dependencies & build app - working-directory: apps/${{ env.APP_NAME }} - run: | - npm ci - TESTING=true npm run build --if-present - - name: Save context uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 with: @@ -83,6 +78,11 @@ jobs: containers: [1, 2, 3, 4, 5, 6, 7, 8] php-versions: [ '8.1' ] server-versions: [ 'master' ] + is-pr: + - ${{ !!github.head_ref }} + exclude: + - is-pr: false + containers: 2 name: runner ${{ matrix.containers }} @@ -145,8 +145,8 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v4 with: - record: true - parallel: true + record: '${{ !!matrix.is-pr }}' # only on pull requests + parallel: '${{ !!matrix.is-pr }}' # only on pull requests wait-on: '${{ env.CYPRESS_baseUrl }}' working-directory: 'apps/${{ env.APP_NAME }}' config: defaultCommandTimeout=10000,video=false