Skip to content

Commit 6e10f48

Browse files
authored
chore(ci): move clippy + test from PR-time CI to release pipeline (#21)
The `clippy + test (macOS ARM64)` job in ci.yml was burning ~15 minutes of the single shared self-hosted Apple Silicon runner on every PR push. That cost was hard to justify given that: - Local developers now have `make verify` / `make verify-clean` which reproduce the exact same `cargo clippy --features metal,accelerate -- -D warnings` + `cargo test --release --features metal,accelerate` invocation, so the runner round-trip wasn't adding signal that wasn't reachable locally. - The self-hosted runner is shared with the release pipeline, and PRs routinely starved release builds for runner time. This commit: 1. Removes the `clippy-and-test` job (and the now-obsolete header comment block) from `.github/workflows/ci.yml`. PR-time CI now runs only the lightweight cargo-deny + cargo-fmt gates on ubuntu. 2. Adds the same fmt / clippy / test steps to `release.yml`'s `build-macos` job, in front of the signed-build step. A clippy or test regression in release builds will now fail the release before any signing or packaging work happens. `release.yml::build-macos` already uses the same self-hosted runner with a persistent cargo target cache, so the lint/test steps benefit from incremental compilation and don't redo the full build for the artifact step that follows.
1 parent 8dcc84c commit 6e10f48

2 files changed

Lines changed: 26 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
# PR / push CI for lightweight quality gates. Builds and tests are covered by
2-
# release.yml (signed artifacts) and pipeline-parallel-ci.yml (distributed
3-
# runs); this workflow runs cargo-deny (license / advisory), cargo-fmt, and
4-
# cargo-clippy + cargo-test checks on every touched-Rust change so formatting
5-
# drift, license issues, and lint/test regressions are caught at PR time.
1+
# PR / push CI for lightweight quality gates. Runs cargo-deny (license /
2+
# advisory) and cargo-fmt on every touched-Rust change so formatting drift and
3+
# license issues are caught at PR time.
4+
#
5+
# Clippy and cargo-test used to run here as `clippy + test (macOS ARM64)` on
6+
# the self-hosted Apple Silicon runner, but each run consumed ~15 minutes of
7+
# that single shared runner per PR push. Those gates were moved to the release
8+
# workflow (`release.yml::build-macos`), which now runs fmt/clippy/test before
9+
# producing signed artifacts. Local developers should run `make verify` (or
10+
# `make verify-clean` for a cache-clear pass) before pushing to catch
11+
# regressions that release-time CI will otherwise surface.
612
#
713
# Note on CUDA gating: CUDA verification stays exclusive to release.yml because
814
# it requires a Linux self-hosted runner (currently only the GB10 node used for
@@ -76,29 +82,3 @@ jobs:
7682
components: rustfmt
7783
- run: cargo fmt --all -- --check
7884

79-
clippy-and-test:
80-
name: clippy + test (macOS ARM64)
81-
needs: changes
82-
# Only run when Rust files changed; block fork-PR access to the self-hosted
83-
# runner pool (mirrors the guard in release.yml and pipeline-parallel-ci.yml).
84-
if: >-
85-
needs.changes.outputs.rust == 'true' &&
86-
github.repository == 'lablup/mlxcel' &&
87-
(github.event_name != 'pull_request' ||
88-
github.event.pull_request.head.repo.full_name == github.repository)
89-
runs-on: self-hosted-macos-26-arm64
90-
permissions:
91-
contents: read
92-
steps:
93-
- uses: actions/checkout@v6
94-
with:
95-
persist-credentials: false
96-
- uses: dtolnay/rust-toolchain@stable
97-
with:
98-
components: clippy
99-
- name: Build (verify MLX FFI compiles)
100-
run: cargo build --release --features metal,accelerate
101-
- name: Clippy
102-
run: cargo clippy --all-targets --features metal,accelerate -- -D warnings
103-
- name: Test
104-
run: cargo test --release --features metal,accelerate

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ jobs:
9696
uses: dtolnay/rust-toolchain@stable
9797
with:
9898
targets: aarch64-apple-darwin
99+
components: clippy, rustfmt
100+
101+
# Quality gate — fmt / clippy / test. Used to live in ci.yml's
102+
# `clippy + test (macOS ARM64)` job, but consumed ~15 min of the shared
103+
# self-hosted runner on every PR push for limited PR-time signal. Moved
104+
# here so the cost is paid once per release. Local devs should run
105+
# `make verify` before pushing to catch regressions earlier.
106+
- name: Format check
107+
run: cargo fmt --all -- --check
108+
109+
- name: Clippy
110+
run: cargo clippy --all-targets --features metal,accelerate -- -D warnings
111+
112+
- name: Test
113+
run: cargo test --release --features metal,accelerate
99114

100115
- name: Build release binaries
101116
run: cargo build --release --target aarch64-apple-darwin --locked

0 commit comments

Comments
 (0)