From ca053e0a118707c29cd42844800303f67ff3cb95 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 21 Sep 2022 10:36:38 +0530 Subject: [PATCH 1/3] Parallel e2e --- .github/workflows/e2e.yml | 40 ++++++++++++++++++++++++--------------- cypress.config.js | 1 + 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 06a346aeb..6d860993e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,30 +9,40 @@ jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: [16.x] + containers: [1, 2, 3] steps: - uses: actions/checkout@v3 + - uses: actions/cache@v3 + id: yarn-and-build-cache + with: + path: | + ~/.cache/Cypress + build + node_modules + key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node_modules-build- + - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: cache: yarn node-version: ${{ matrix.node-version }} - - name: Install Yarn - run: npm i yarn --global - - - name: Install Packages - run: | - yarn install --frozen-lockfile + # Install NPM dependencies, cache them correctly + # and run all Cypress tests + - name: Cypress run + uses: cypress-io/github-action@v3 + with: + build: yarn build + start: yarn dev + wait-on: 'http://localhost:9000' + record: true + headless: true + parallel: true env: - CYPRESS_CACHE_FOLDER: .cache/Cypress - - - name: Run Build - run: yarn build - - - name: Run E2E Tests - run: yarn e2e - env: - CYPRESS_CACHE_FOLDER: .cache/Cypress + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} diff --git a/cypress.config.js b/cypress.config.js index b434cec47..6fe0ae5ab 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -4,6 +4,7 @@ const { defineConfig } = require('cypress'); const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin'); module.exports = defineConfig({ + projectId: 'n2sma2', e2e: { specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}', setupNodeEvents(on, config) { From 51df0a68ccf5c03d1008b911bbf6d0da0c5d4b66 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 21 Sep 2022 10:41:47 +0530 Subject: [PATCH 2/3] Remove build --- .github/workflows/e2e.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 6d860993e..e17aef464 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -38,7 +38,6 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v3 with: - build: yarn build start: yarn dev wait-on: 'http://localhost:9000' record: true From 55d706323d4982b92e24ad7e4300a519b38b2b73 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 21 Sep 2022 10:42:27 +0530 Subject: [PATCH 3/3] CI Concurrency 4 --- .github/workflows/e2e.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e17aef464..194f87054 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: node-version: [16.x] - containers: [1, 2, 3] + containers: [1, 2, 3, 4] steps: - uses: actions/checkout@v3