Skip to content

Commit b209a40

Browse files
cpsievertclaude
andcommitted
ci: build Python wheel once per OS, test across Python versions
Split the Python CI workflow into build and test phases. The build job compiles the abi3 wheel once per OS, then test jobs download and install it across Python 3.10-3.13. This avoids redundant Rust compilation — particularly on Windows where builds take ~30 min each. Also removes path filters so Python tests run on all repo changes, since the build overhead is now minimal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 254a2b0 commit b209a40

1 file changed

Lines changed: 30 additions & 6 deletions

File tree

.github/workflows/python.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@ name: Python
22

33
on:
44
push:
5-
paths: ['ggsql-python/**', '.github/workflows/python.yml']
65
pull_request:
7-
paths: ['ggsql-python/**', '.github/workflows/python.yml']
86

97
jobs:
10-
test:
8+
build:
119
strategy:
1210
fail-fast: false
1311
matrix:
1412
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python: ['3.10', '3.11', '3.12', '3.13']
1613
runs-on: ${{ matrix.os }}
1714
steps:
1815
- uses: actions/checkout@v4
1916

2017
- uses: actions/setup-python@v5
2118
with:
22-
python-version: ${{ matrix.python }}
19+
python-version: '3.10'
2320

2421
- uses: actions/setup-node@v4
2522
with:
@@ -45,10 +42,37 @@ jobs:
4542
args: --release
4643
sccache: true
4744

45+
- name: Upload wheel
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: wheel-${{ matrix.os }}
49+
path: target/wheels/ggsql-*.whl
50+
51+
test:
52+
needs: build
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
os: [ubuntu-latest, macos-latest, windows-latest]
57+
python: ['3.10', '3.11', '3.12', '3.13']
58+
runs-on: ${{ matrix.os }}
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: actions/setup-python@v5
63+
with:
64+
python-version: ${{ matrix.python }}
65+
66+
- name: Download wheel
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: wheel-${{ matrix.os }}
70+
path: dist
71+
4872
- name: Install wheel and test dependencies
4973
shell: bash
5074
run: |
51-
WHEEL=$(ls target/wheels/ggsql-*.whl)
75+
WHEEL=$(ls dist/ggsql-*.whl)
5276
pip install "${WHEEL}[test]"
5377
5478
- name: Run tests

0 commit comments

Comments
 (0)