|
1 | | -# SPDX-License-Identifier: MPL-2.0-or-later |
| 1 | +# SPDX-License-Identifier: MPL-2.0 |
| 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. |
2 | 5 | name: Rust CI |
3 | | -on: [push, pull_request] |
4 | 6 |
|
5 | | -permissions: read-all |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [main, master] |
| 10 | + pull_request: |
6 | 11 |
|
7 | | -env: |
8 | | - CARGO_TERM_COLOR: always |
9 | | - RUSTFLAGS: -Dwarnings |
| 12 | +permissions: |
| 13 | + contents: read |
10 | 14 |
|
11 | 15 | jobs: |
12 | | - test: |
13 | | - runs-on: ubuntu-latest |
14 | | - steps: |
15 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
16 | | - - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable |
17 | | - with: |
18 | | - components: rustfmt, clippy |
19 | | - - uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2 |
20 | | - |
21 | | - - name: Check formatting |
22 | | - run: cargo fmt --all -- --check |
23 | | - |
24 | | - - name: Clippy lints |
25 | | - run: cargo clippy --all-targets --all-features -- -D warnings |
26 | | - |
27 | | - - name: Run tests |
28 | | - run: cargo test --all-features |
29 | | - |
30 | | - - name: Build release |
31 | | - run: cargo build --release |
32 | | - |
33 | | - security: |
34 | | - runs-on: ubuntu-latest |
35 | | - steps: |
36 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
37 | | - - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable |
38 | | - - name: Install cargo-audit |
39 | | - run: cargo install cargo-audit |
40 | | - - name: Security audit |
41 | | - run: cargo audit |
42 | | - - name: Check for outdated deps |
43 | | - run: cargo install cargo-outdated && cargo outdated --exit-code 1 || true |
44 | | - |
45 | | - coverage: |
46 | | - runs-on: ubuntu-latest |
47 | | - steps: |
48 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
49 | | - - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable |
50 | | - - name: Install tarpaulin |
51 | | - run: cargo install cargo-tarpaulin |
52 | | - - name: Generate coverage |
53 | | - run: cargo tarpaulin --out Xml |
54 | | - - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6 |
55 | | - with: |
56 | | - files: cobertura.xml |
| 16 | + rust-ci: |
| 17 | + uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@4fdf4314b4ab54269adbaff10e30e483b5e86845 |
| 18 | + with: |
| 19 | + enable_audit: true |
| 20 | + enable_coverage: true |
0 commit comments