chore: should able to update snapshots #14
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: Playwright Tests | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
# Allow updating snapshots during automatic runs | ||
inputs: | ||
update-snapshots: | ||
description: "Update snapshots?" | ||
type: boolean | ||
# Allow updating snapshots during manual runs | ||
workflow_call: | ||
inputs: | ||
update-snapshots: | ||
description: "Update snapshots?" | ||
type: boolean | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | ||
with: | ||
node-version: 20.x | ||
- name: Install dependencies | ||
run: npm install -g pnpm && pnpm install | ||
- name: Install Playwright Browsers | ||
- name: Install deps | ||
run: | | ||
pnpm install | ||
pnpm exec playwright install | ||
- name: Set up cache | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
key: cache/${{github.repository}}/${{github.ref}} | ||
restore-keys: cache/${{github.repository}}/refs/heads/master | ||
path: .test/** | ||
- name: Initialize snapshots | ||
if: ${{steps.cache.outputs.cache-hit != 'true' || inputs.update-snapshots == 'true'}} | ||
run: pnpm exec playwright test --update-snapshots | ||
- name: Test | ||
run: pnpm exec playwright test |