-
Notifications
You must be signed in to change notification settings - Fork 339
50 lines (38 loc) · 1.32 KB
/
screenshots.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
name: Percy screenshots
on:
workflow_call:
workflow_dispatch:
concurrency:
group: screenshots-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
screenshots:
name: Send screenshots
runs-on: ubuntu-22.04
env:
PERCY_POSTINSTALL_BROWSER: false
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PUPPETEER_SKIP_DOWNLOAD: true
# Skip when secrets are unavailable on forks
if: ${{ !github.event.pull_request.head.repo.fork }}
steps:
- name: Check secrets
if: ${{ !env.PERCY_TOKEN }}
run: echo "::warning title=GitHub Actions secrets::Workflow requires 'PERCY_TOKEN' secret"
- name: Checkout
uses: actions/[email protected]
- name: Install dependencies
uses: ./.github/workflows/actions/install-node
- name: Cache browser download
uses: actions/[email protected]
with:
# Use faster GNU tar for all runners
enableCrossOsArchive: true
key: puppeteer-${{ runner.os }}
path: .cache/puppeteer
- name: Build
uses: ./.github/workflows/actions/build
- name: Start review app
run: npm start --workspace @govuk-frontend/review &
- name: Send screenshots to Percy
run: npx --workspace @govuk-frontend/review percy exec -- npm run test:screenshots