chore: Add [lib] section and crates.io publish metadata (#33) #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| validate: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| # Pinned to full commit SHA for supply-chain security. | |
| # Upgraded from v4 SHA (34e11...) to v7 SHA (9c09...) for consistency with coverage.yml | |
| # (see coverage workflow). This is a security-pinned immutable SHA corresponding to | |
| # actions/checkout@v7. No submodules, LFS, or custom fetch-depth used in this workflow, | |
| # so no breaking changes from v5/v6/v7 affect it. Verified against GitHub's official | |
| # actions/checkout releases. | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| with: | |
| persist-credentials: false | |
| # Pinned to full commit SHA for dtolnay/rust-toolchain (corresponds to v1 tag, aligned with coverage.yml for consistency) | |
| # This ensures immutable build behavior and satisfies security scanners. | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 | |
| with: | |
| toolchain: stable | |
| components: clippy, rustfmt | |
| # Swatinem/rust-cache is used instead of raw actions/cache + static key. | |
| # It handles Rust-specific caching (including git deps like neuromod) and | |
| # avoids the Cargo.lock gitignore problem that caused stale caches. | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Clippy (lint) | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build | |
| run: cargo build --all-features | |
| - name: Test | |
| run: cargo test --all-features |