Skip to content

Commit ea9de47

Browse files
committed
chore: update CI netlify triggers and related docs
1 parent 3e193ed commit ea9de47

4 files changed

Lines changed: 75 additions & 93 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: E2E on Netlify Deploy Ready
2+
3+
on:
4+
status:
5+
workflow_dispatch:
6+
inputs:
7+
ref:
8+
description: "Git ref (branch or sha) to test manually"
9+
required: false
10+
type: string
11+
base_url:
12+
description: "Base URL to run E2E against for manual runs"
13+
required: false
14+
type: string
15+
16+
jobs:
17+
e2e-tests:
18+
if: |
19+
(
20+
github.event_name == 'workflow_dispatch' &&
21+
(github.event.inputs.ref == '' || github.event.inputs.ref == 'dev')
22+
) ||
23+
(
24+
github.event_name == 'status' &&
25+
github.event.state == 'success' &&
26+
github.event.context == 'netlify/ethereumorg/deploy-preview' &&
27+
(
28+
contains(github.event.branches.*.name, 'dev') ||
29+
contains(github.event.branches.*.name, 'feat/deterministic-netlify-waits')
30+
)
31+
)
32+
runs-on: ubuntu-latest
33+
env:
34+
CI: true
35+
steps:
36+
- uses: actions/checkout@v6
37+
with:
38+
ref: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.ref) || github.event.sha || github.sha }}
39+
40+
- name: Setup pnpm
41+
uses: pnpm/action-setup@v4
42+
43+
- uses: actions/setup-node@v6
44+
with:
45+
node-version: lts/*
46+
cache: pnpm
47+
48+
- name: Install dependencies
49+
run: pnpm install
50+
51+
- name: Resolve target URL
52+
id: netlify_deploy
53+
run: |
54+
set -euo pipefail
55+
URL="${{ github.event.inputs.base_url || github.event.target_url || '' }}"
56+
if [ -z "$URL" ]; then
57+
echo "No deploy URL available in event payload." >&2
58+
exit 1
59+
fi
60+
echo "url=$URL" >> "$GITHUB_OUTPUT"
61+
62+
- name: Install Playwright with all browsers
63+
run: npx playwright install --with-deps
64+
65+
- name: Run E2E Tests
66+
run: pnpm test:e2e
67+
env:
68+
PLAYWRIGHT_TEST_BASE_URL: ${{ steps.netlify_deploy.outputs.url }}
69+
70+
- uses: actions/upload-artifact@v4
71+
if: always()
72+
with:
73+
name: playwright-report
74+
path: ./tests/__results__
75+
retention-days: 7

.github/workflows/lighthouse-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v6
19-
- name: Sleep for 60 minutes
20-
run: sleep 3600
2119
- name: Wait for Netlify Deploy
2220
id: netlify_deploy
2321
uses: probablyup/[email protected]

.github/workflows/tests.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Tests
22
on:
33
pull_request:
44
branches: [dev, master, staging]
5-
workflow_dispatch:
65

76
jobs:
87
unit-tests:
@@ -25,46 +24,3 @@ jobs:
2524

2625
- name: Run Unit Tests
2726
run: pnpm test:unit
28-
29-
e2e-tests:
30-
if: github.event_name == 'workflow_dispatch'
31-
runs-on: ubuntu-latest
32-
env:
33-
CI: true
34-
steps:
35-
- uses: actions/checkout@v6
36-
37-
- name: Setup pnpm
38-
uses: pnpm/action-setup@v4
39-
40-
- uses: actions/setup-node@v6
41-
with:
42-
node-version: lts/*
43-
cache: pnpm
44-
45-
- name: Install dependencies
46-
run: pnpm install
47-
48-
- name: Get Netlify Deploy URL for branch
49-
id: netlify_deploy
50-
run: |
51-
npx ts-node -O '{ "module": "commonjs" }' src/scripts/get-netlify-branch-deploy.ts
52-
env:
53-
NETLIFY_SITE_ID: "e8f2e766-888b-4954-8500-1b647d84db99"
54-
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
55-
GITHUB_REF_NAME: ${{ github.ref_name }}
56-
57-
- name: Install Playwright with all browsers
58-
run: npx playwright install --with-deps
59-
60-
- name: Run E2E Tests
61-
run: pnpm test:e2e
62-
env:
63-
PLAYWRIGHT_TEST_BASE_URL: ${{ steps.netlify_deploy.outputs.url }}
64-
65-
- uses: actions/upload-artifact@v4
66-
if: always()
67-
with:
68-
name: playwright-report
69-
path: ./tests/__results__
70-
retention-days: 7

src/scripts/get-netlify-branch-deploy.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)