|
| 1 | +name: CI (PFS-MS) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + branches: [master] |
| 8 | + |
| 9 | +env: |
| 10 | + CARGO_TERM_COLOR: always |
| 11 | + RUSTFLAGS: "-D warnings" |
| 12 | + |
| 13 | +defaults: |
| 14 | + run: |
| 15 | + working-directory: reference/PFS-MS-v1.0 |
| 16 | + |
| 17 | +jobs: |
| 18 | + fmt: |
| 19 | + name: rustfmt |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + - uses: dtolnay/rust-toolchain@stable |
| 24 | + with: |
| 25 | + components: rustfmt |
| 26 | + - run: cargo fmt --all -- --check |
| 27 | + |
| 28 | + clippy: |
| 29 | + name: clippy |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - uses: dtolnay/rust-toolchain@stable |
| 34 | + with: |
| 35 | + components: clippy |
| 36 | + - uses: Swatinem/rust-cache@v2 |
| 37 | + with: |
| 38 | + workspaces: reference/PFS-MS-v1.0 |
| 39 | + - run: cargo clippy --all-targets --all-features -- -D warnings |
| 40 | + |
| 41 | + test: |
| 42 | + name: test (${{ matrix.os }}) |
| 43 | + runs-on: ${{ matrix.os }} |
| 44 | + strategy: |
| 45 | + fail-fast: false |
| 46 | + matrix: |
| 47 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + - uses: dtolnay/rust-toolchain@stable |
| 51 | + - uses: Swatinem/rust-cache@v2 |
| 52 | + with: |
| 53 | + workspaces: reference/PFS-MS-v1.0 |
| 54 | + - run: cargo build --verbose |
| 55 | + - run: cargo test --all-targets --verbose |
| 56 | + - run: cargo test --doc --verbose |
| 57 | + |
| 58 | + test-vector: |
| 59 | + name: regenerate spec test vector |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + - uses: dtolnay/rust-toolchain@stable |
| 64 | + - uses: Swatinem/rust-cache@v2 |
| 65 | + with: |
| 66 | + workspaces: reference/PFS-MS-v1.0 |
| 67 | + - name: Build and run the test-vector example |
| 68 | + run: cargo run --example gen_testvector |
| 69 | + - name: Inspect generated test vector |
| 70 | + run: | |
| 71 | + ls -l pfs_ms_testvector.bin |
| 72 | + test "$(wc -c < pfs_ms_testvector.bin)" = "2986" |
| 73 | + - uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: pfs-ms-testvector |
| 76 | + path: reference/PFS-MS-v1.0/pfs_ms_testvector.bin |
| 77 | + |
| 78 | + coverage: |
| 79 | + name: code coverage |
| 80 | + runs-on: ubuntu-latest |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + - uses: dtolnay/rust-toolchain@stable |
| 84 | + with: |
| 85 | + components: llvm-tools-preview |
| 86 | + - uses: Swatinem/rust-cache@v2 |
| 87 | + with: |
| 88 | + workspaces: reference/PFS-MS-v1.0 |
| 89 | + - name: Install cargo-llvm-cov |
| 90 | + uses: taiki-e/install-action@cargo-llvm-cov |
| 91 | + - name: Generate coverage report (lcov) |
| 92 | + run: cargo llvm-cov --all-features --lcov --output-path lcov.info |
| 93 | + - name: Print coverage summary |
| 94 | + run: cargo llvm-cov report |
| 95 | + # The `pfs` CLI binary is exercised manually, not by `cargo test`; the |
| 96 | + # library floor is enforced over everything except the binary and examples. |
| 97 | + - name: Enforce minimum library coverage |
| 98 | + run: | |
| 99 | + cargo llvm-cov report --summary-only \ |
| 100 | + --ignore-filename-regex 'bin/|examples/' \ |
| 101 | + --fail-under-lines 90 \ |
| 102 | + --fail-under-functions 90 |
| 103 | + - uses: actions/upload-artifact@v4 |
| 104 | + with: |
| 105 | + name: pfs-ms-coverage-lcov |
| 106 | + path: reference/PFS-MS-v1.0/lcov.info |
0 commit comments