Skip to content

Commit 3035233

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 3b66f3f commit 3035233

1 file changed

Lines changed: 37 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,43 @@ 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: bash scripts/build_driver.sh
32+
- name: Upload driver bundles
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: driver-bundles
36+
path: driver/playwright-*.zip
37+
if-no-files-found: error
38+
# The bundles are already-compressed zips; skip re-compression.
39+
compression-level: 0
40+
retention-days: 1
41+
2042
infra:
2143
name: Lint
44+
needs: build-driver
2245
runs-on: ubuntu-latest
2346
steps:
2447
- uses: actions/checkout@v6
2548
- name: Set up Python
2649
uses: actions/setup-python@v6
2750
with:
2851
python-version: "3.10"
29-
- name: Set up Node.js
30-
uses: actions/setup-node@v4
52+
- name: Download driver bundles
53+
uses: actions/download-artifact@v4
3154
with:
32-
node-version: '24'
55+
name: driver-bundles
56+
path: driver/
3357
- name: Install dependencies & browsers
3458
run: |
3559
python -m pip install --upgrade pip
@@ -47,6 +71,7 @@ jobs:
4771

4872
build:
4973
name: Build
74+
needs: build-driver
5075
timeout-minutes: 45
5176
strategy:
5277
fail-fast: false
@@ -100,10 +125,11 @@ jobs:
100125
uses: actions/setup-python@v6
101126
with:
102127
python-version: ${{ matrix.python-version }}
103-
- name: Set up Node.js
104-
uses: actions/setup-node@v4
128+
- name: Download driver bundles
129+
uses: actions/download-artifact@v4
105130
with:
106-
node-version: '24'
131+
name: driver-bundles
132+
path: driver/
107133
- name: Install dependencies & browsers
108134
run: |
109135
python -m pip install --upgrade pip
@@ -133,6 +159,7 @@ jobs:
133159

134160
test-stable:
135161
name: Stable
162+
needs: build-driver
136163
timeout-minutes: 45
137164
strategy:
138165
fail-fast: false
@@ -151,10 +178,11 @@ jobs:
151178
uses: actions/setup-python@v6
152179
with:
153180
python-version: "3.10"
154-
- name: Set up Node.js
155-
uses: actions/setup-node@v4
181+
- name: Download driver bundles
182+
uses: actions/download-artifact@v4
156183
with:
157-
node-version: '24'
184+
name: driver-bundles
185+
path: driver/
158186
- name: Install dependencies & browsers
159187
run: |
160188
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)