Percy screenshots #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-latest | |
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 |