Merge pull request #20 from kduma-OSS/claude/serene-cori-NhxyH #43
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 / Rust (PFS-MS Reference) | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: "-D warnings" | |
| defaults: | |
| run: | |
| working-directory: reference/PFS-MS-v1.0 | |
| jobs: | |
| fmt: | |
| name: rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: reference/PFS-MS-v1.0 | |
| - run: cargo clippy --all-targets --all-features -- -D warnings | |
| test: | |
| name: test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: reference/PFS-MS-v1.0 | |
| - run: cargo build --verbose | |
| - run: cargo test --all-targets --verbose | |
| - run: cargo test --doc --verbose | |
| test-vector: | |
| name: regenerate spec test vector | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: reference/PFS-MS-v1.0 | |
| - name: Build and run the test-vector example | |
| run: cargo run --example gen_testvector | |
| - name: Inspect generated test vector | |
| run: | | |
| ls -l pfs_ms_testvector.bin | |
| test "$(wc -c < pfs_ms_testvector.bin)" = "3066" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: pfs-ms-testvector | |
| path: reference/PFS-MS-v1.0/pfs_ms_testvector.bin | |
| coverage: | |
| name: code coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: reference/PFS-MS-v1.0 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Generate coverage report (lcov) | |
| run: cargo llvm-cov --all-features --lcov --output-path lcov.info | |
| - name: Print coverage summary | |
| run: cargo llvm-cov report | |
| # The `pfs` CLI binary is exercised manually, not by `cargo test`; the | |
| # library floor is enforced over everything except the binary and examples. | |
| - name: Enforce minimum library coverage | |
| run: | | |
| cargo llvm-cov report --summary-only \ | |
| --ignore-filename-regex 'bin/|examples/' \ | |
| --fail-under-lines 90 \ | |
| --fail-under-functions 90 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: pfs-ms-coverage-lcov | |
| path: reference/PFS-MS-v1.0/lcov.info |