Create npm workspace for E2E tests #14471
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Visual Regression Testing | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
- 'feature/**' | |
# Only run if CSS/JS related files changed. | |
paths: | |
- '.github/workflows/visual-regression.yml' | |
- 'assets/**' | |
- '!assets/**/__tests__/**/*.js' | |
- '!assets/**/test/*.js' | |
- '!assets/**/*.test.js' | |
- '**.stories.js' | |
- 'tests/backstop/**' | |
- '.storybook/**' | |
- '**.scss' | |
- '.nvmrc' | |
- '**/package.json' | |
- 'package-lock.json' | |
- 'src/tests/backstop/config.js' | |
- 'docker/backstopjs/Dockerfile' | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
concurrency: | |
group: visual-regression-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
visual-regression: | |
name: Run VR Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
if: github.event.pull_request.draft == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js (.nvmrc) | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
# nvm@7 is the minimum version required for npm workspace support. | |
# This is needed to prevent js lint failures due to module resolution to the workspace packages. | |
# This can be removed once our node base version comes with nvm@7 or greater. | |
- name: Install npm Globally | |
run: npm run install-global-npm | |
- name: npm install | |
run: npm ci | |
- name: Run Backstopjs | |
run: npm run test:visualtest | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: vrt-report | |
path: | | |
tests/backstop/html_report | |
tests/backstop/reference | |
tests/backstop/tests |