Merge pull request #3498 from sidharthv96/sidv/parallelE2E

[DevOps] Parallel E2E
This commit is contained in:
Knut Sveidqvist
2022-09-21 09:15:07 +02:00
committed by GitHub
2 changed files with 25 additions and 15 deletions

View File

@@ -9,30 +9,39 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false
matrix: matrix:
node-version: [16.x] node-version: [16.x]
containers: [1, 2, 3, 4]
steps: steps:
- uses: actions/checkout@v3 - 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 }} - name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
cache: yarn cache: yarn
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
- name: Install Yarn # Install NPM dependencies, cache them correctly
run: npm i yarn --global # and run all Cypress tests
- name: Cypress run
- name: Install Packages uses: cypress-io/github-action@v3
run: | with:
yarn install --frozen-lockfile start: yarn dev
wait-on: 'http://localhost:9000'
record: true
headless: true
parallel: true
env: env:
CYPRESS_CACHE_FOLDER: .cache/Cypress CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Run Build
run: yarn build
- name: Run E2E Tests
run: yarn e2e
env:
CYPRESS_CACHE_FOLDER: .cache/Cypress

View File

@@ -4,6 +4,7 @@ const { defineConfig } = require('cypress');
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin'); const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
module.exports = defineConfig({ module.exports = defineConfig({
projectId: 'n2sma2',
e2e: { e2e: {
specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}', specPattern: 'cypress/integration/**/*.{js,jsx,ts,tsx}',
setupNodeEvents(on, config) { setupNodeEvents(on, config) {