Skip to content

Commit cd59be0

Browse files
Skn0ttCopilot
andcommitted
CI: build driver once on Linux, share bundles as an artifact
The per-job source build can't run on Windows (Git Bash lacks zip/unzip and the heavy upstream monorepo build is not exercised there), and rebuilding the fully cross-platform driver in every wheel job is redundant and slow. Add a single 'build-driver' job that builds all six platform bundles on Linux and uploads them as a workflow artifact. Every wheel-building job (Lint, Build, Stable, Conda) now downloads that artifact into driver/ so setup.py's ensure_driver_bundle early-returns and embeds the prebuilt zip -- no Node, bash or zip/unzip needed on Windows/macOS. A verify step asserts all six bundles are present before building. Docker and Azure publish are unchanged: they run on Linux and build the driver once on their own host, which already works. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent aef89df commit cd59be0

1 file changed

Lines changed: 65 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 65 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,33 @@ concurrency:
1717
cancel-in-progress: true
1818

1919
jobs:
20+
build-driver:
21+
name: Build driver
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 60
24+
steps:
25+
- uses: actions/checkout@v5
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '24'
30+
- name: Build driver bundles from source
31+
run: |
32+
VERSION="$(grep -oP 'driver_version = "\K[^"]+' setup.py)"
33+
bash scripts/build_driver.sh "$VERSION"
34+
- name: Upload driver bundles
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: driver-bundles
38+
path: driver/playwright-*.zip
39+
if-no-files-found: error
40+
# The bundles are already-compressed zips; skip re-compression.
41+
compression-level: 0
42+
retention-days: 1
43+
2044
infra:
2145
name: Lint
46+
needs: build-driver
2247
runs-on: ubuntu-latest
2348
steps:
2449
- uses: actions/checkout@v5
@@ -30,6 +55,16 @@ jobs:
3055
uses: actions/setup-node@v4
3156
with:
3257
node-version: '24'
58+
- name: Download driver bundles
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: driver-bundles
62+
path: driver/
63+
- name: Verify driver bundles
64+
shell: bash
65+
run: |
66+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
67+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
3368
- name: Install dependencies & browsers
3469
run: |
3570
python -m pip install --upgrade pip
@@ -47,6 +82,7 @@ jobs:
4782

4883
build:
4984
name: Build
85+
needs: build-driver
5086
timeout-minutes: 45
5187
strategy:
5288
fail-fast: false
@@ -100,10 +136,16 @@ jobs:
100136
uses: actions/setup-python@v6
101137
with:
102138
python-version: ${{ matrix.python-version }}
103-
- name: Set up Node.js
104-
uses: actions/setup-node@v4
139+
- name: Download driver bundles
140+
uses: actions/download-artifact@v4
105141
with:
106-
node-version: '24'
142+
name: driver-bundles
143+
path: driver/
144+
- name: Verify driver bundles
145+
shell: bash
146+
run: |
147+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
148+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
107149
- name: Install dependencies & browsers
108150
run: |
109151
python -m pip install --upgrade pip
@@ -133,6 +175,7 @@ jobs:
133175

134176
test-stable:
135177
name: Stable
178+
needs: build-driver
136179
timeout-minutes: 45
137180
strategy:
138181
fail-fast: false
@@ -151,10 +194,16 @@ jobs:
151194
uses: actions/setup-python@v6
152195
with:
153196
python-version: "3.10"
154-
- name: Set up Node.js
155-
uses: actions/setup-node@v4
197+
- name: Download driver bundles
198+
uses: actions/download-artifact@v4
156199
with:
157-
node-version: '24'
200+
name: driver-bundles
201+
path: driver/
202+
- name: Verify driver bundles
203+
shell: bash
204+
run: |
205+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
206+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
158207
- name: Install dependencies & browsers
159208
run: |
160209
python -m pip install --upgrade pip
@@ -180,6 +229,7 @@ jobs:
180229

181230
build-conda:
182231
name: Conda Build
232+
needs: build-driver
183233
strategy:
184234
fail-fast: false
185235
matrix:
@@ -196,6 +246,15 @@ jobs:
196246
- uses: actions/checkout@v5
197247
with:
198248
fetch-depth: 0
249+
- name: Download driver bundles
250+
uses: actions/download-artifact@v4
251+
with:
252+
name: driver-bundles
253+
path: driver/
254+
- name: Verify driver bundles
255+
run: |
256+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
257+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
199258
- name: Get conda
200259
uses: conda-incubator/setup-miniconda@v3
201260
with:

0 commit comments

Comments
 (0)