Repository navigation
e2e #10020
This file contains hidden or 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: e2e | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| url: | |
| required: false | |
| description: The URL to run the test suite against. If omitted, it runs against all. | |
| type: string | |
| deployment_status: | |
| permissions: {} | |
| jobs: | |
| e2e: | |
| environment: | |
| name: ${{ github.event.deployment.environment || 'Production' }} | |
| url: ${{ github.event.inputs.url || github.event.deployment_status.environment_url }} | |
| # On `deployment_status`, only run for deploys of a branch in this repo. Vercel sets | |
| # `deployment.ref` to the branch name for same-repo deploys and to the bare SHA for | |
| # fork-PR deploys, so `ref == sha` indicates an untrusted source. | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.deployment_status.state == 'success' && | |
| github.event.deployment.ref != github.event.deployment.sha) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - uses: pnpm/setup@703c52620218391530e48b9e8870d5c0082e1b9b # v2.1.0 | |
| with: | |
| cache: true | |
| - run: pnpm exec playwright install | |
| - name: Run Playwright E2E tests | |
| run: pnpm test:browser | |
| env: | |
| BASE_URL: ${{ github.event.inputs.url || github.event.deployment_status.environment_url }} | |
| lighthouse: | |
| environment: | |
| name: ${{ github.event.deployment.environment || 'Production' }} | |
| url: ${{ github.event.inputs.url || github.event.deployment_status.environment_url }} | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.deployment_status.state == 'success' && | |
| github.event.deployment.ref != github.event.deployment.sha) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - name: Audit URLs using Lighthouse | |
| uses: treosh/lighthouse-ci-action@3e7e23fb74242897f95c0ba9cabad3d0227b9b18 # v12 | |
| with: | |
| urls: ${{ github.event.inputs.url || github.event.deployment_status.environment_url }} | |
| uploadArtifacts: true | |
| temporaryPublicStorage: true | |
| env: | |
| LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
| warmup: | |
| environment: | |
| name: ${{ github.event.deployment.environment || 'Production' }} | |
| url: ${{ github.event.inputs.url || github.event.deployment_status.environment_url }} | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| (github.event.deployment_status.state == 'success' && | |
| github.event.deployment.ref != github.event.deployment.sha) | |
| runs-on: ubuntu-slim | |
| steps: | |
| - name: warmup jobs, sponsors and modules | |
| run: | | |
| curl -sS "$BASE_URL/api/jobs" | |
| curl -sS "$BASE_URL/api/sponsors" | |
| curl -sS "$BASE_URL/api/v1/modules" | |
| env: | |
| BASE_URL: ${{ github.event.inputs.url || github.event.deployment_status.environment_url }} |