-
Notifications
You must be signed in to change notification settings - Fork 43
64 lines (61 loc) · 1.91 KB
/
update_visual_snapshots.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
name: Snapshots
on:
pull_request:
types: [labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update:
if: ${{ github.event.label.name == 'update snapshots' }}
name: 'Update snapshots'
runs-on:
labels: ubuntu-latest-16-cores
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.VRT_APP_ID }}
private-key: ${{ secrets.VRT_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
token: ${{ steps.generate_token.outputs.token }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci --no-audit --no-fund --ignore-scripts
- name: Install browsers
run: npx playwright install --with-deps
- name: Build tokens
run: npm run build:tokens
- name: Build storybook
working-directory: docs/storybook
run: |
npm ci
npm run build-storybook
- name: Run storybook
id: storybook
run: |
npx serve -l 6006 storybook-static &
pid=$!
echo "pid=$pid" >> $GITHUB_OUTPUT
sleep 5
working-directory: docs/storybook
- name: Run Visual Regression Tests
run: npx playwright test --update-snapshots
- name: Stop storybook
run: kill ${{ steps.storybook.outputs.pid }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: github-actions[bot] Regenerated snapshots
- uses: actions-ecosystem/action-remove-labels@v1
if: always()
with:
labels: 'update snapshots'