Skip to content

Commit 154bd49

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 b8b8072 commit 154bd49

1 file changed

Lines changed: 39 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,45 @@ 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/
3359
- name: Install dependencies & browsers
3460
run: |
3561
python -m pip install --upgrade pip
@@ -47,6 +73,7 @@ jobs:
4773

4874
build:
4975
name: Build
76+
needs: build-driver
5077
timeout-minutes: 45
5178
strategy:
5279
fail-fast: false
@@ -100,10 +127,11 @@ jobs:
100127
uses: actions/setup-python@v6
101128
with:
102129
python-version: ${{ matrix.python-version }}
103-
- name: Set up Node.js
104-
uses: actions/setup-node@v4
130+
- name: Download driver bundles
131+
uses: actions/download-artifact@v4
105132
with:
106-
node-version: '24'
133+
name: driver-bundles
134+
path: driver/
107135
- name: Install dependencies & browsers
108136
run: |
109137
python -m pip install --upgrade pip
@@ -133,6 +161,7 @@ jobs:
133161

134162
test-stable:
135163
name: Stable
164+
needs: build-driver
136165
timeout-minutes: 45
137166
strategy:
138167
fail-fast: false
@@ -151,10 +180,11 @@ jobs:
151180
uses: actions/setup-python@v6
152181
with:
153182
python-version: "3.10"
154-
- name: Set up Node.js
155-
uses: actions/setup-node@v4
183+
- name: Download driver bundles
184+
uses: actions/download-artifact@v4
156185
with:
157-
node-version: '24'
186+
name: driver-bundles
187+
path: driver/
158188
- name: Install dependencies & browsers
159189
run: |
160190
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)