Skip to content

DO NOT MERGE | QAH-354 | Add Github action workflow for updating visual test snapshots #5

DO NOT MERGE | QAH-354 | Add Github action workflow for updating visual test snapshots

DO NOT MERGE | QAH-354 | Add Github action workflow for updating visual test snapshots #5

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and update visual test snapshots for playwright tests.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
permissions:
contents: write
packages: write
id-token: write
name: Update Visual Test Snapshots
on:
pull_request:
branches:
- main
jobs:
update_snapshots:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.32.1-focal
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: ./.github/actions/node-step
with:
npm-auth-token: ${{ secrets.NPM_TOKEN }}
- name: Install browsers
run: npx playwright install --with-deps chromium firefox webkit
shell: bash
- name: Run update snapshots
run: HOME=/root npm run e2e-update-snapshots
- name: Setup git user to "GSA Action"
run: git config user.email "[email protected]" && git config user.name "GitHub Actions"
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
commit: "Update Playwright visual test snapshots"
- name: Push Changes to target branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'QAH-354-Add-GHA-for-updating-visual-test-snapshots'