-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.37 KB
/
visual-testing.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
name: Run visual testing
on:
pull_request:
types: [opened, synchronize, reopened]
env:
ASTRO_PREVIEW_SERVER_PORT_FOR_VISUAL_TESTING: 4321
jobs:
visual-testing:
if: ${{ contains(github.event.pull_request.labels.*.name, 'visual-testing') || startsWith(github.head_ref, 'renovate/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
# should be temporary. fix: https://vercel.com/guides/corepack-errors-github-actions
- name: Install corepack
shell: "bash"
run: npm install -g corepack@latest
- name: Setup PNPM using corepack
shell: "bash"
run: |
corepack enable
corepack install
- name: Install
shell: "bash"
run: pnpm i
- name: Build
shell: "bash"
run: pnpm build
- name: Start website preview server for visual testing
run: pnpm preview --port $ASTRO_PREVIEW_SERVER_PORT_FOR_VISUAL_TESTING &
- name: Take yuna.work screenshots and upload them to Percy
run: |
pnpm wait-on tcp:$ASTRO_PREVIEW_SERVER_PORT_FOR_VISUAL_TESTING
pnpm percy snapshot .percy.mjs --debug
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}