ci: release automation (git-cliff changelog + tag on merge); publish … #10
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] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Format / Clippy / Test / Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Check clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Run tests | |
| run: cargo test --all-features -- --test-threads=1 | |
| - name: Check documentation | |
| run: cargo doc --no-deps --all-features | |
| coverage: | |
| name: Coverage (>=80% lines) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: llvm-tools-preview | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| # The crate's own logic (DigMessage / DigMessageType / introducer wire types) | |
| # is feature-independent — the `native-tls` / `rustls` features only forward | |
| # TLS re-exports from chia-sdk-client (pure glue with no coverable lines here). | |
| # Measuring default features keeps the gate fast and focused on this crate's code. | |
| # lib.rs is excluded from the floor: it is re-export-only with no own logic. | |
| - name: Run coverage with 80% line floor | |
| run: | | |
| cargo llvm-cov \ | |
| --ignore-filename-regex 'src/lib\.rs' \ | |
| --fail-under-lines 80 \ | |
| -- --test-threads=1 | |
| - name: Coverage summary | |
| if: always() | |
| run: | | |
| cargo llvm-cov report --summary-only -- --test-threads=1 |