diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 06a346aeb..194f87054 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,30 +9,39 @@ jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: [16.x] + containers: [1, 2, 3, 4] 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: + 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.cjs b/cypress.config.cjs index b434cec47..6fe0ae5ab 100644 --- a/cypress.config.cjs +++ b/cypress.config.cjs @@ -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) {