Skip to content

Commit 3f79422

Browse files
ci(rust): convert rust-ci.yml to thin wrapper (standards#174) (#17)
Replaces the per-repo `rust-ci.yml` copy with a 5-line wrapper invoking the shared reusable workflow in `hyperpolymath/standards` (PR #174). Pinned to PR #174's HEAD SHA `4fdf4314b4ab54269adbaff10e30e483b5e86845`; will resolve to standards/main once #174 merges. Estate audit found ~87 rust-ci.yml copies across the estate; this is one of them. The reusable provides identical cargo check/clippy/fmt/test behaviour with opt-in `enable_audit` + `enable_coverage` inputs. Pattern precedent: standards#168 (governance-reusable) + downstream wrappers absolute-zero#41 + tma-mark2#41. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a688f21 commit 3f79422

1 file changed

Lines changed: 6 additions & 58 deletions

File tree

.github/workflows/rust-ci.yml

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,17 @@
11
# SPDX-License-Identifier: MPL-2.0
2-
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3-
#
4-
# rust-ci.yml — Cargo build, test, clippy, and fmt for Rust projects.
5-
# Only runs if Cargo.toml exists in the repo root.
2+
# Rust CI — thin wrapper calling the shared estate reusable in
3+
# hyperpolymath/standards. Configure once, propagate everywhere.
4+
# See: docs/CI-REUSABLE-WORKFLOWS.adoc in standards.
65
name: Rust CI
76

87
on:
9-
pull_request:
10-
branches: ['**']
118
push:
129
branches: [main, master]
10+
pull_request:
1311

1412
permissions:
1513
contents: read
1614

1715
jobs:
18-
check:
19-
name: Cargo check + clippy + fmt
20-
runs-on: ubuntu-latest
21-
if: hashFiles('Cargo.toml') != ''
22-
23-
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
26-
27-
- name: Install Rust toolchain
28-
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
29-
with:
30-
components: clippy, rustfmt
31-
32-
- name: Cache cargo registry and build
33-
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
34-
35-
- name: Cargo check
36-
run: cargo check --all-targets 2>&1
37-
38-
- name: Cargo fmt
39-
run: cargo fmt --all -- --check
40-
41-
- name: Cargo clippy
42-
run: cargo clippy --all-targets -- -D warnings
43-
44-
test:
45-
name: Cargo test
46-
runs-on: ubuntu-latest
47-
needs: check
48-
if: hashFiles('Cargo.toml') != ''
49-
50-
steps:
51-
- name: Checkout repository
52-
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
53-
54-
- name: Install Rust toolchain
55-
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
56-
57-
- name: Cache cargo registry and build
58-
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
59-
60-
- name: Run tests
61-
run: cargo test --all-targets
62-
63-
- name: Write summary
64-
if: always()
65-
run: |
66-
echo "## Rust CI Results" >> "$GITHUB_STEP_SUMMARY"
67-
echo "" >> "$GITHUB_STEP_SUMMARY"
68-
echo "- **cargo check**: passed" >> "$GITHUB_STEP_SUMMARY"
69-
echo "- **cargo test**: completed" >> "$GITHUB_STEP_SUMMARY"
16+
rust-ci:
17+
uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@4fdf4314b4ab54269adbaff10e30e483b5e86845

0 commit comments

Comments
 (0)