-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 1.97 KB
/
update-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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Update VRT screenshots
on:
workflow_dispatch:
env:
HUSKY: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
TURBO_CACHE_DIR: .turbo
VRT_BROWSER: chromium
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: 'true'
token: ${{ secrets.BOT_TOKEN }}
- name: Pull LFS files
run: git lfs pull
- name: Restore turbo cache
uses: actions/cache/restore@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Use pnpm
uses: pnpm/action-setup@v2
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'pnpm'
- name: Install dependencies
# change to pnpm ci once it is implemented
run: |
pnpm i --frozen-lockfile --loglevel warn
pnpm exec playwright install --with-deps ${{ env.VRT_BROWSER }}
- name: Run tests
run: pnpm run vrt-update --cache-dir="${{ env.TURBO_CACHE_DIR }}"
- name: Commit updated screenshots
run: |
git add -- **/vrt/screenshots/**/*
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "Github Actions [Bot]"
git commit -m "test: update vrt screenshots"
git push
- name: Upload report
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: vrt-report
path: |
apps/*/vrt/report
packages/*/vrt/report
retention-days: 1
- name: Save turbo cache
uses: actions/cache/save@v3
if: success() || failure()
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turbo-${{ github.sha }}