forked from nuxt/nuxt.com
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (75 loc) · 3.05 KB
/
Copy pathe2e.yml
File metadata and controls
81 lines (75 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- run: corepack enable
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: lts/-1
- run: pnpm install --frozen-lockfile
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
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-latest
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 }}