Skip to content

Commit 1a6bda2

Browse files
authored
Merge pull request ensdomains#955 from ensdomains/FET-1736
ci: optimise ci build time
2 parents ec48ba4 + 9ea8a23 commit 1a6bda2

File tree

3 files changed

+44
-85
lines changed

3 files changed

+44
-85
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: "Setup Playwright"
2+
description: "Setup Playwright with pnpm (should already be installed)"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install Playwright
7+
shell: bash
8+
run: pnpm exec playwright install --with-deps chromium

.github/actions/setup/action.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Setup Environment'
2+
description: 'Sets up Node.js and pnpm'
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Install pnpm
7+
uses: pnpm/action-setup@v4
8+
with:
9+
version: 9.3.0
10+
11+
- name: Install Node.js
12+
uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
cache: 'pnpm'
16+
17+
- name: Install dependencies
18+
shell: bash
19+
run: pnpm install --frozen-lockfile
20+
21+
- name: Install Playwright Browsers and Dependencies
22+
shell: bash
23+
run: pnpm exec playwright install --with-deps

.github/workflows/test.yaml

Lines changed: 13 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,10 @@ env:
77

88
jobs:
99
coverage:
10-
runs-on: ubuntu-latest
10+
runs-on: blacksmith-4vcpu-ubuntu-2404
1111
steps:
1212
- uses: actions/checkout@v4
13-
14-
- name: Install corepack
15-
run: npm i -g corepack
16-
17-
- name: Install pnpm
18-
run: npm i -g --force corepack && corepack enable pnpm
19-
20-
- name: Install Node.js
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 20
24-
cache: 'pnpm'
25-
26-
- run: pnpm install --frozen-lockfile
13+
- uses: ./.github/actions/setup
2714

2815
- name: Get contract addresses
2916
run: 'parallel --lb --halt now,success=1,fail=1 ::: \
@@ -33,23 +20,10 @@ jobs:
3320
- run: pnpm test:coverage
3421

3522
build-stateless:
36-
runs-on: ubuntu-latest
23+
runs-on: blacksmith-4vcpu-ubuntu-2404
3724
steps:
3825
- uses: actions/checkout@v4
39-
40-
- name: Install corepack
41-
run: npm i -g corepack
42-
43-
- name: Install pnpm
44-
run: npm i -g --force corepack && corepack enable pnpm
45-
46-
- name: Install Node.js
47-
uses: actions/setup-node@v4
48-
with:
49-
node-version: 20
50-
cache: 'pnpm'
51-
52-
- run: pnpm install --frozen-lockfile
26+
- uses: ./.github/actions/setup
5327

5428
- name: Get contract addresses
5529
run: 'parallel --lb --halt now,success=1,fail=1 ::: \
@@ -69,23 +43,10 @@ jobs:
6943
path: stateless-build.tar
7044

7145
build-stateful:
72-
runs-on: ubuntu-latest
46+
runs-on: blacksmith-4vcpu-ubuntu-2404
7347
steps:
7448
- uses: actions/checkout@v4
75-
76-
- name: Install corepack
77-
run: npm i -g corepack
78-
79-
- name: Install pnpm
80-
run: npm i -g --force corepack && corepack enable pnpm
81-
82-
- name: Install Node.js
83-
uses: actions/setup-node@v4
84-
with:
85-
node-version: 20
86-
cache: 'pnpm'
87-
88-
- run: pnpm install --frozen-lockfile
49+
- uses: ./.github/actions/setup
8950

9051
- name: Build stateful and export
9152
run: pnpm build && pnpm export
@@ -103,7 +64,7 @@ jobs:
10364
name: stateless (${{matrix.shard}})
10465
needs: build-stateless
10566
timeout-minutes: 20
106-
runs-on: ubuntu-latest
67+
runs-on: blacksmith-4vcpu-ubuntu-2404
10768
strategy:
10869
matrix:
10970
shard:
@@ -140,20 +101,8 @@ jobs:
140101
]
141102
steps:
142103
- uses: actions/checkout@v4
143-
144-
- name: Install corepack
145-
run: npm i -g corepack
146-
147-
- name: Install pnpm
148-
run: npm i -g --force corepack && corepack enable pnpm
149-
150-
- name: Install Node.js
151-
uses: actions/setup-node@v4
152-
with:
153-
node-version: 20
154-
cache: 'pnpm'
155-
156-
- run: pnpm install --frozen-lockfile
104+
- uses: ./.github/actions/setup
105+
- uses: ./.github/actions/setup-playwright
157106

158107
- run: pnpm rebuild -r
159108

@@ -167,9 +116,6 @@ jobs:
167116
- name: Untar files
168117
run: tar -xvf stateless-build.tar
169118

170-
- name: Install playwright
171-
run: pnpm playwright install chromium
172-
173119
- name: Run tests
174120
run: |
175121
PLAYWRIGHT_SHARD=${{matrix.shard}} PLAYWRIGHT_TOTAL=${{strategy.job-total}} pnpm e2e:ci --no-build
@@ -186,28 +132,14 @@ jobs:
186132
name: stateful (${{matrix.shard}})
187133
needs: build-stateful
188134
timeout-minutes: 10
189-
runs-on: ubuntu-latest
135+
runs-on: blacksmith-4vcpu-ubuntu-2404
190136
strategy:
191137
matrix:
192138
shard: [1, 2, 3]
193-
194139
steps:
195140
- uses: actions/checkout@v4
196-
- run: ./scripts/check-chrome.sh
197-
198-
- name: Install corepack
199-
run: npm i -g corepack
200-
201-
- name: Install pnpm
202-
run: npm i -g --force corepack && corepack enable pnpm
203-
204-
- name: Install Node.js
205-
uses: actions/setup-node@v4
206-
with:
207-
node-version: 20
208-
cache: 'pnpm'
209-
210-
- run: pnpm install --frozen-lockfile
141+
- uses: ./.github/actions/setup
142+
- uses: ./.github/actions/setup-playwright
211143

212144
- run: pnpm rebuild -r
213145

@@ -220,16 +152,12 @@ jobs:
220152
- name: Untar files
221153
run: tar -xvf stateful-build.tar
222154

223-
- name: Install playwright
224-
run: pnpm playwright install chromium
225-
226155
- name: Run tests
227156
run: |
228157
parallel --lb --halt now,success=1,fail=1 ::: \
229158
"pnpm wrangle" \
230-
"pnpm wait-on http://127.0.0.1:8788 && pnpm playwright test --shard=${{matrix.shard}}/${{strategy.job-total}} --project=stateful"
159+
"pnpm wait-on http://127.0.0.1:8788 && npx playwright test --shard=${{matrix.shard}}/${{strategy.job-total}} --project=stateful"
231160
env:
232-
NEXT_PUBLIC_CHAIN_NAME: holesky
233161
SECRET_WORDS: ${{ secrets.SECRET_WORDS }}
234162

235163
- uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)