Skip to content

Commit cb66850

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 7a69477 commit cb66850

1 file changed

Lines changed: 54 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,50 @@ 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@v6
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@v6
2550
- name: Set up Python
2651
uses: actions/setup-python@v6
2752
with:
2853
python-version: "3.10"
29-
- name: Set up Node.js
30-
uses: actions/setup-node@v4
54+
- name: Download driver bundles
55+
uses: actions/download-artifact@v4
3156
with:
32-
node-version: '24'
57+
name: driver-bundles
58+
path: driver/
59+
- name: Verify driver bundles
60+
shell: bash
61+
run: |
62+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
63+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
3364
- name: Install dependencies & browsers
3465
run: |
3566
python -m pip install --upgrade pip
@@ -47,6 +78,7 @@ jobs:
4778

4879
build:
4980
name: Build
81+
needs: build-driver
5082
timeout-minutes: 45
5183
strategy:
5284
fail-fast: false
@@ -100,10 +132,16 @@ jobs:
100132
uses: actions/setup-python@v6
101133
with:
102134
python-version: ${{ matrix.python-version }}
103-
- name: Set up Node.js
104-
uses: actions/setup-node@v4
135+
- name: Download driver bundles
136+
uses: actions/download-artifact@v4
105137
with:
106-
node-version: '24'
138+
name: driver-bundles
139+
path: driver/
140+
- name: Verify driver bundles
141+
shell: bash
142+
run: |
143+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
144+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
107145
- name: Install dependencies & browsers
108146
run: |
109147
python -m pip install --upgrade pip
@@ -133,6 +171,7 @@ jobs:
133171

134172
test-stable:
135173
name: Stable
174+
needs: build-driver
136175
timeout-minutes: 45
137176
strategy:
138177
fail-fast: false
@@ -151,10 +190,16 @@ jobs:
151190
uses: actions/setup-python@v6
152191
with:
153192
python-version: "3.10"
154-
- name: Set up Node.js
155-
uses: actions/setup-node@v4
193+
- name: Download driver bundles
194+
uses: actions/download-artifact@v4
156195
with:
157-
node-version: '24'
196+
name: driver-bundles
197+
path: driver/
198+
- name: Verify driver bundles
199+
shell: bash
200+
run: |
201+
count="$(ls driver/playwright-*.zip 2>/dev/null | wc -l)"
202+
test "$count" -eq 6 || { echo "Expected 6 driver bundles in driver/, found $count"; ls -la driver/ || true; exit 1; }
158203
- name: Install dependencies & browsers
159204
run: |
160205
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)