ilios/frontend

View on GitHub
.github/workflows/percy-test-pr.yml

Summary

Maintainability
Test Coverage
name: Percy PR Tests

on:
  pull_request_target:
    types: [labeled, opened, reopened, synchronize]

concurrency:
  group: percy-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

env:
  SW_DISABLED: true
  COVERAGE: false
  PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ILIOS_DEPLOYMENT_WEBHOOK_URL }}

jobs:
  percy:
    name: Test and Capture Screenshots
    if: contains(github.event.pull_request.labels.*.name, 'run percy tests')
    runs-on: ubuntu-latest
    timeout-minutes: 20
    strategy:
      fail-fast: false
      matrix:
        workspace:
          - frontend
          - test-app
    steps:
      - uses: actions/checkout@v4
        with:
          ref: "${{ github.event.pull_request.merge_commit_sha }}"
      - uses: pnpm/action-setup@v4
        with:
          version: 9
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: pnpm
      - run: pnpm install
      - name: Run Percy Tests
        run: pnpm --filter ${{matrix.workspace}} exec percy exec -- ember test