-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (42 loc) · 1.22 KB
/
vrt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: VRT
on:
push:
branches:
- main
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm build
- run: |
npx playwright install --with-deps
npx playwright test
working-directory: site
update-snapshot:
needs: [check]
runs-on: ubuntu-latest
defaults:
run:
working-directory: site
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: npx playwright install --with-deps
- run: npx playwright test --update-snapshots
- run: gi add -N .; git diff --name-only --exit-code
id: git-diff
continue-on-error: true
- if: steps.git-diff.outcome == 'failure'
run: |
set -x
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "chore: update snapshots"
git pull --rebase
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}