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: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.environment_url }} cancel-in-progress: true jobs: playwright: environment: name: ${{ github.event.deployment.environment || 'Production' }} url: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.environment_url }} if: github.event.deployment_status.state == 'success' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 15 container: image: mcr.microsoft.com/playwright:v1.63.0-noble steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0 with: cache: true install: false - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install playwright run: pnpm playwright install - run: pnpm test:e2e env: BASE_URL: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.environment_url }} - name: Upload playwright report if: ${{ !cancelled() }} uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: playwright-report path: | playwright-report test-results retention-days: 14 lighthouse: environment: name: ${{ github.event.deployment.environment || 'Production' }} url: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.environment_url }} if: github.event.deployment_status.state == 'success' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - run: curl ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.environment_url }} - name: Audit URLs using Lighthouse uses: treosh/lighthouse-ci-action@3e7e23fb74242897f95c0ba9cabad3d0227b9b18 # 12.6.2 with: urls: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.environment_url }} uploadArtifacts: true temporaryPublicStorage: true budgetPath: ./budget.json runs: 3 env: LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}