Skip to content

Commit 401d146

Browse files
ianhiclaude
andcommitted
Implement sccache and matrix-based CI optimization
Major improvements: - Add sccache to maturin builds for faster Rust compilation across CI runs - Replace uv sync with maturin-action + sccache for Python wheel building - Convert individual platform jobs to matrix strategy for cleaner code - Remove Python test dependencies on shared-build - now run in parallel - Eliminate complex artifact sharing - each job builds independently with cache Benefits: - Python and Rust tests run in parallel (faster CI) - sccache provides persistent Rust compilation cache - Cleaner GitHub Actions dependency graph - Reduced complexity while maintaining performance - Better caching strategy that works across rebuilds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4e97d71 commit 401d146

File tree

3 files changed

+59
-81
lines changed

3 files changed

+59
-81
lines changed

.github/workflows/ci-coordinator.yaml

Lines changed: 40 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -18,91 +18,55 @@ env:
1818
RUST_CHANNEL: '1.89.0'
1919

2020
jobs:
21-
# Essential builds for PR testing
22-
build_ubuntu:
23-
name: Build Ubuntu
24-
uses: ./.github/workflows/shared-build.yaml
25-
with:
26-
rust_channel: '1.89.0'
27-
target: x86_64
28-
runner: ubuntu-latest
29-
30-
build_macos_arm:
31-
name: Build macOS ARM
32-
uses: ./.github/workflows/shared-build.yaml
33-
with:
34-
rust_channel: '1.89.0'
35-
target: aarch64
36-
runner: macos-14
37-
38-
build_windows:
39-
name: Build Windows
40-
uses: ./.github/workflows/shared-build.yaml
41-
with:
42-
rust_channel: '1.89.0'
43-
target: x86_64
44-
runner: windows-latest
45-
46-
# Platform-specific tests (start immediately after Rust builds)
47-
test_ubuntu:
48-
name: Test Ubuntu
49-
needs: [build_ubuntu]
21+
# Matrix-based Rust builds and tests
22+
rust_tests:
23+
name: Rust Tests (${{ matrix.platform.name }})
24+
strategy:
25+
matrix:
26+
platform:
27+
- name: Ubuntu
28+
target: x86_64
29+
runner: ubuntu-latest
30+
include_docker: true
31+
- name: macOS ARM
32+
target: aarch64
33+
runner: macos-14
34+
include_docker: false
35+
- name: Windows
36+
target: x86_64
37+
runner: windows-latest
38+
include_docker: false
5039
uses: ./.github/workflows/rust-testing-safe.yaml
5140
with:
52-
target: x86_64
53-
runner: ubuntu-latest
54-
include_docker_tests: true
55-
56-
test_macos_arm:
57-
name: Test macOS ARM
58-
needs: [build_macos_arm]
59-
uses: ./.github/workflows/rust-testing-safe.yaml
60-
with:
61-
target: aarch64
62-
runner: macos-14
63-
include_docker_tests: false
64-
65-
test_windows:
66-
name: Test Windows
67-
needs: [build_windows]
68-
uses: ./.github/workflows/rust-testing-safe.yaml
69-
with:
70-
target: x86_64
71-
runner: windows-latest
72-
include_docker_tests: false
73-
74-
# Python tests (builds wheels internally using Rust artifacts)
75-
python_tests_ubuntu:
76-
name: Python Tests Ubuntu
77-
needs: [build_ubuntu]
78-
uses: ./.github/workflows/python-testing.yaml
79-
with:
41+
target: ${{ matrix.platform.target }}
42+
runner: ${{ matrix.platform.runner }}
43+
include_docker_tests: ${{ matrix.platform.include_docker }}
8044
rust_channel: '1.89.0'
81-
target: x86_64
82-
runner: ubuntu-latest
8345

84-
python_tests_macos_arm:
85-
name: Python Tests macOS ARM
86-
needs: [build_macos_arm]
46+
# Matrix-based Python tests with sccache
47+
python_tests:
48+
name: Python Tests (${{ matrix.platform.name }})
49+
strategy:
50+
matrix:
51+
platform:
52+
- name: Ubuntu
53+
target: x86_64
54+
runner: ubuntu-latest
55+
- name: macOS ARM
56+
target: aarch64
57+
runner: macos-14
58+
- name: Windows
59+
target: x86_64
60+
runner: windows-latest
8761
uses: ./.github/workflows/python-testing.yaml
8862
with:
8963
rust_channel: '1.89.0'
90-
target: aarch64
91-
runner: macos-14
92-
93-
python_tests_windows:
94-
name: Python Tests Windows
95-
needs: [build_windows]
96-
uses: ./.github/workflows/python-testing.yaml
97-
with:
98-
rust_channel: '1.89.0'
99-
target: x86_64
100-
runner: windows-latest
64+
target: ${{ matrix.platform.target }}
65+
runner: ${{ matrix.platform.runner }}
10166

10267
# Integration tests with cloud credentials
10368
test_integration:
10469
name: Test Integration
105-
needs: [build_ubuntu]
10670
if: ${{
10771
github.event_name == 'schedule'
10872
|| github.event_name == 'workflow_dispatch'
@@ -116,16 +80,14 @@ jobs:
11680
target: x86_64
11781
runner: ubuntu-latest
11882

119-
# Code quality checks (reuse Ubuntu build for efficiency)
83+
# Code quality checks (build wheels with sccache, run in parallel)
12084
linting:
12185
name: Code Quality
122-
needs: [build_ubuntu]
12386
uses: ./.github/workflows/linting.yaml
12487

125-
# Dependency checks (runs independently, depends on Ubuntu build)
88+
# Dependency checks (runs independently)
12689
dependency_check:
12790
name: Dependency Check
128-
needs: [build_ubuntu]
12991
uses: ./.github/workflows/dependency-check.yaml
13092
with:
13193
rust_channel: '1.89.0'

.github/workflows/linting.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,18 @@ jobs:
7070
run: just pre-commit-python
7171

7272
# Python setup and linting
73+
- name: Build Python wheel with sccache
74+
uses: PyO3/maturin-action@v1
75+
with:
76+
working-directory: icechunk-python
77+
target: x86_64
78+
args: --release --out dist --find-interpreter
79+
sccache: true
80+
7381
- name: Setup Python linting environment
7482
working-directory: ./icechunk-python
7583
run: |
76-
uv sync --extra test
84+
uv sync --extra test --find-links dist
7785
uv add pre-commit
7886
7987
- name: Run Python pre-commit linting

.github/workflows/python-testing.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,24 @@ jobs:
6969
cache-all-crates: true
7070
cache-on-failure: true
7171

72+
- name: Build Python wheel with sccache
73+
uses: PyO3/maturin-action@v1
74+
with:
75+
working-directory: icechunk-python
76+
target: ${{ inputs.target }}
77+
args: --release --out dist --find-interpreter
78+
sccache: true
79+
7280
- name: Install uv
7381
uses: astral-sh/setup-uv@v6
7482
with:
7583
enable-cache: true
7684

77-
# Install and test using uv sync which will build the project
85+
# Install and test using the pre-built wheel
7886
- name: Setup test environment
7987
working-directory: ./icechunk-python
8088
run: |
81-
uv sync --extra test
89+
uv sync --extra test --find-links dist
8290
8391
- name: Run Python tests
8492
working-directory: ./icechunk-python

0 commit comments

Comments
 (0)