diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 388eae9c..c462b241 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,4 +1,4 @@ -name: test +name: e2e on: workflow_dispatch: @@ -10,7 +10,7 @@ on: deployment_status: jobs: - e2e: + playwright: environment: name: ${{ github.event.deployment.environment || 'Production' }} url: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.target_url }} @@ -33,3 +33,21 @@ jobs: - run: pnpm test:e2e env: BASE_URL: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.target_url }} + + lighthouse: + environment: + name: ${{ github.event.deployment.environment || 'Production' }} + url: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.target_url }} + if: github.event.deployment_status.state == 'success' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Audit URLs using Lighthouse + uses: treosh/lighthouse-ci-action@v9 + with: + urls: ${{ github.event.inputs.url || github.event.deployment.payload.web_url || github.event.deployment_status.target_url }} + uploadArtifacts: true + temporaryPublicStorage: true + budgetPath: ./budget.json + env: + LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} diff --git a/budget.json b/budget.json new file mode 100644 index 00000000..924ffac4 --- /dev/null +++ b/budget.json @@ -0,0 +1,37 @@ +[ + { + "path": "/", + "resourceSizes": [ + { + "resourceType": "document", + "budget": 8 + }, + { + "resourceType": "script", + "budget": 87 + }, + { + "resourceType": "stylesheet", + "budget": 9 + }, + { + "resourceType": "other", + "budget": 4 + } + ], + "resourceCounts": [ + { + "resourceType": "third-party", + "budget": 1 + }, + { + "resourceType": "script", + "budget": 13 + }, + { + "resourceType": "font", + "budget": 3 + } + ] + } +]