Skip to content

Commit 883fc39

Browse files
linesightclaude
andcommitted
ci: flatten wheel pipeline and deduplicate CEF download
Merge compile/test/wheel into a single matrix job per Python version so that each version's pipeline is fully independent — a 3.11 failure no longer delays the 3.10 wheel. Extract CEF download into a dedicated job to avoid 5 concurrent downloads of the same 600 MB archive from Spotify's CDN. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 39b31cc commit 883fc39

2 files changed

Lines changed: 79 additions & 138 deletions

File tree

.github/workflows/ci-linux.yml

Lines changed: 39 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,43 @@ on:
1313
default: false
1414

1515
jobs:
16-
compile:
16+
download-cef:
1717
runs-on: ubuntu-24.04
18-
timeout-minutes: 60
18+
timeout-minutes: 15
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.10"
27+
28+
- name: Read CEF version
29+
id: cef-version
30+
run: |
31+
ver=$(grep -oP '(?<=#define CEF_VERSION ")[^"]+' src/version/cef_version_linux.h)
32+
echo "value=$ver" >> $GITHUB_OUTPUT
33+
34+
- name: Cache CEF binaries
35+
uses: actions/cache@v4
36+
if: ${{ inputs.bypass_cache != true }}
37+
with:
38+
path: |
39+
build/cef_binary_*
40+
build/cef*_linux64
41+
key: cef-linux64-${{ steps.cef-version.outputs.value }}
42+
43+
- name: Install build tools
44+
run: python tools/requirements.py
45+
46+
- name: Download CEF binaries
47+
run: python tools/download_cef.py
48+
49+
wheel:
50+
needs: download-cef
51+
runs-on: ubuntu-24.04
52+
timeout-minutes: 75
1953
strategy:
2054
fail-fast: false
2155
matrix:
@@ -36,8 +70,8 @@ jobs:
3670
ver=$(grep -oP '(?<=#define CEF_VERSION ")[^"]+' src/version/cef_version_linux.h)
3771
echo "value=$ver" >> $GITHUB_OUTPUT
3872
39-
- name: Cache CEF binaries
40-
uses: actions/cache@v4
73+
- name: Restore CEF cache
74+
uses: actions/cache/restore@v4
4175
if: ${{ inputs.bypass_cache != true }}
4276
with:
4377
path: |
@@ -59,9 +93,6 @@ jobs:
5993
- name: Install build tools
6094
run: python tools/requirements.py
6195

62-
- name: Download CEF binaries
63-
run: python tools/download_cef.py
64-
6596
- name: Prepare prebuilt CEF
6697
run: python tools/automate.py --prebuilt-cef
6798

@@ -81,47 +112,15 @@ jobs:
81112
! -name 'cefclient*' ! -name 'cefsimple*' ! -name 'ceftests*' ! -name 'chrome-sandbox' \
82113
-exec cp -r {} build/artifacts/ \;
83114
84-
- name: Upload build artifacts
85-
uses: actions/upload-artifact@v4
86-
with:
87-
name: build-py${{ matrix.python-version }}-linux64
88-
path: build/artifacts/
89-
retention-days: 1
90-
91-
test:
92-
needs: compile
93-
runs-on: ubuntu-24.04
94-
timeout-minutes: 30
95-
strategy:
96-
fail-fast: false
97-
matrix:
98-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
99-
100-
steps:
101-
- name: Checkout
102-
uses: actions/checkout@v4
103-
104-
- name: Set up Python
105-
uses: actions/setup-python@v5
106-
with:
107-
python-version: ${{ matrix.python-version }}
108-
109115
- name: Install runtime dependencies
110116
run: |
111-
sudo apt-get update -q
112117
sudo apt-get install -y --no-install-recommends \
113118
libnss3 libatk1.0-0 libatk-bridge2.0-0 \
114119
libx11-6 libxcomposite1 libxdamage1 libxext6 \
115120
libxfixes3 libxrandr2 libxrender1 \
116121
libgtk2.0-0 libglib2.0-0 xvfb
117122
118-
- name: Download build artifacts
119-
uses: actions/download-artifact@v4
120-
with:
121-
name: build-py${{ matrix.python-version }}-linux64
122-
path: build/artifacts/
123-
124-
- name: Set up cefpython3 package for testing
123+
- name: Set up cefpython3 package
125124
run: |
126125
cp -r build/artifacts/. cefpython3/
127126
chmod +x cefpython3/subprocess
@@ -134,35 +133,6 @@ jobs:
134133
env:
135134
PYTHONPATH: ${{ github.workspace }}
136135

137-
wheel:
138-
needs: test
139-
runs-on: ubuntu-24.04
140-
timeout-minutes: 15
141-
strategy:
142-
fail-fast: false
143-
matrix:
144-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
145-
146-
steps:
147-
- name: Checkout
148-
uses: actions/checkout@v4
149-
150-
- name: Set up Python
151-
uses: actions/setup-python@v5
152-
with:
153-
python-version: ${{ matrix.python-version }}
154-
155-
- name: Download build artifacts
156-
uses: actions/download-artifact@v4
157-
with:
158-
name: build-py${{ matrix.python-version }}-linux64
159-
path: build/artifacts/
160-
161-
- name: Set up cefpython3 package
162-
run: |
163-
cp -r build/artifacts/. cefpython3/
164-
chmod +x cefpython3/subprocess
165-
166136
- name: Build wheel
167137
run: python tools/build_distrib.py
168138

.github/workflows/ci-windows.yml

Lines changed: 40 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,44 @@ on:
1313
default: false
1414

1515
jobs:
16-
compile:
16+
download-cef:
1717
runs-on: windows-latest
18-
timeout-minutes: 60
18+
timeout-minutes: 15
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.10"
27+
28+
- name: Read CEF version
29+
id: cef-version
30+
run: |
31+
$ver = (Select-String -Path src/version/cef_version_win.h `
32+
-Pattern '#define CEF_VERSION "([^"]+)"').Matches[0].Groups[1].Value
33+
echo "value=$ver" >> $env:GITHUB_OUTPUT
34+
35+
- name: Cache CEF binaries
36+
uses: actions/cache@v4
37+
if: ${{ inputs.bypass_cache != true }}
38+
with:
39+
path: |
40+
build/cef_binary_*
41+
build/cef*_win64
42+
key: cef-windows64-${{ steps.cef-version.outputs.value }}
43+
44+
- name: Install build tools
45+
run: python tools/requirements.py
46+
47+
- name: Download CEF binaries
48+
run: python tools/download_cef.py
49+
50+
wheel:
51+
needs: download-cef
52+
runs-on: windows-latest
53+
timeout-minutes: 75
1954
strategy:
2055
fail-fast: false
2156
matrix:
@@ -37,8 +72,8 @@ jobs:
3772
-Pattern '#define CEF_VERSION "([^"]+)"').Matches[0].Groups[1].Value
3873
echo "value=$ver" >> $env:GITHUB_OUTPUT
3974
40-
- name: Cache CEF binaries
41-
uses: actions/cache@v4
75+
- name: Restore CEF cache
76+
uses: actions/cache/restore@v4
4277
if: ${{ inputs.bypass_cache != true }}
4378
with:
4479
path: |
@@ -49,9 +84,6 @@ jobs:
4984
- name: Install build tools
5085
run: python tools/requirements.py
5186

52-
- name: Download CEF binaries
53-
run: python tools/download_cef.py
54-
5587
- name: Prepare prebuilt CEF
5688
run: python tools/automate.py --prebuilt-cef
5789

@@ -70,38 +102,7 @@ jobs:
70102
Get-ChildItem $cefBin | Where-Object { $_.Name -notmatch '^(cefclient|cefsimple|ceftests)' } |
71103
ForEach-Object { Copy-Item $_.FullName build/artifacts/ -Recurse -Force }
72104
73-
- name: Upload build artifacts
74-
uses: actions/upload-artifact@v4
75-
with:
76-
name: build-py${{ matrix.python-version }}-win64
77-
path: build/artifacts/
78-
retention-days: 1
79-
80-
test:
81-
needs: compile
82-
runs-on: windows-latest
83-
timeout-minutes: 30
84-
strategy:
85-
fail-fast: false
86-
matrix:
87-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
88-
89-
steps:
90-
- name: Checkout
91-
uses: actions/checkout@v4
92-
93-
- name: Set up Python
94-
uses: actions/setup-python@v5
95-
with:
96-
python-version: ${{ matrix.python-version }}
97-
98-
- name: Download build artifacts
99-
uses: actions/download-artifact@v4
100-
with:
101-
name: build-py${{ matrix.python-version }}-win64
102-
path: build/artifacts/
103-
104-
- name: Set up cefpython3 package for testing
105+
- name: Set up cefpython3 package
105106
run: |
106107
Get-ChildItem build/artifacts/ | ForEach-Object {
107108
Copy-Item $_.FullName cefpython3/ -Recurse -Force
@@ -112,36 +113,6 @@ jobs:
112113
env:
113114
PYTHONPATH: ${{ github.workspace }}
114115

115-
wheel:
116-
needs: test
117-
runs-on: windows-latest
118-
timeout-minutes: 15
119-
strategy:
120-
fail-fast: false
121-
matrix:
122-
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
123-
124-
steps:
125-
- name: Checkout
126-
uses: actions/checkout@v4
127-
128-
- name: Set up Python
129-
uses: actions/setup-python@v5
130-
with:
131-
python-version: ${{ matrix.python-version }}
132-
133-
- name: Download build artifacts
134-
uses: actions/download-artifact@v4
135-
with:
136-
name: build-py${{ matrix.python-version }}-win64
137-
path: build/artifacts/
138-
139-
- name: Set up cefpython3 package
140-
run: |
141-
Get-ChildItem build/artifacts/ | ForEach-Object {
142-
Copy-Item $_.FullName cefpython3/ -Recurse -Force
143-
}
144-
145116
- name: Build wheel
146117
run: python tools/build_distrib.py
147118

0 commit comments

Comments
 (0)