Skip to content

Commit da31861

Browse files
authored
ci: add clippy and cargo test gates via self-hosted macOS runner (#14)
Closes #5. Adds a `clippy-and-test` job to `.github/workflows/ci.yml` that runs on `self-hosted-macos-26-arm64` for every Rust-touching PR/push, gated on the same `needs: changes` path-filter as the existing `deny` and `fmt` jobs and protected with the fork-PR + repository guard pattern used in `release.yml` and `pipeline-parallel-ci.yml`. Steps: - `cargo build --release --features metal,accelerate` - `cargo clippy --all-targets --features metal,accelerate -- -D warnings` - `cargo test --release --features metal,accelerate` CUDA gating intentionally stays exclusive to `release.yml`: PR-level CUDA verification would require a Linux self-hosted runner and double the cost for limited additional safety on PRs that do not touch CUDA-specific code paths. `CONTRIBUTING.md` quality-gate list updated to reflect the new CI enforcement. Merged with the clippy-and-test job still in-progress on the first run (cold MLX C++ build can take 15-30+ minutes); a follow-up fix PR will be filed if that first run uncovers an environmental issue.
1 parent 3b80a5a commit da31861

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# PR / push CI for lightweight quality gates. Builds and tests are covered by
22
# release.yml (signed artifacts) and pipeline-parallel-ci.yml (distributed
3-
# runs); this workflow runs cargo-deny (license / advisory) and cargo-fmt
4-
# checks on every touched-Rust change so formatting drift and license issues
5-
# are caught at PR time.
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.
6+
#
7+
# Note on CUDA gating: CUDA verification stays exclusive to release.yml because
8+
# it requires a Linux self-hosted runner (currently only the GB10 node used for
9+
# release builds). Adding a PR-level CUDA gate would double runner cost for
10+
# limited additional safety on PRs that don't touch CUDA-specific code paths.
611

712
name: CI
813

@@ -70,3 +75,30 @@ jobs:
7075
with:
7176
components: rustfmt
7277
- run: cargo fmt --all -- --check
78+
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

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ Thank you for your interest in contributing to mlxcel! This document covers the
4242
4. Run the local quality gates:
4343
```bash
4444
cargo fmt --all -- --check # enforced by CI; fmt violations block merge
45-
cargo clippy --all-targets -- -D warnings
45+
cargo clippy --all-targets --features metal,accelerate -- -D warnings # enforced by CI on self-hosted macOS runner
46+
cargo test --release --features metal,accelerate # enforced by CI on self-hosted macOS runner
4647
cargo deny check # advisories + licenses + sources
4748
```
49+
CI enforces `clippy` (with `-D warnings`) and `cargo test` on the `self-hosted-macos-26-arm64` runner on every PR that touches Rust files. CUDA verification is not gated at PR time — that stays exclusive to `release.yml`.
4850
5. For inference changes, validate against a real checkpoint — synthetic or build-only validation is not enough (see [`AGENTS.md`](AGENTS.md) for why).
4951
6. Commit with a conventional prefix (see below) and a clear message.
5052
7. Push to your fork and open a Pull Request. The PR template will prompt for a summary, test plan, and linked issues.

0 commit comments

Comments
 (0)