Next #24
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"] | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Lint | |
| run: cargo clippy --all-features --all-targets -- -D warnings | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| feature_set: | |
| - all-features | |
| - no-default-features | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: | | |
| if [ "${{ matrix.feature_set }}" = "all-features" ]; then | |
| cargo test --all-features --all-targets | |
| else | |
| cargo test --no-default-features --all-targets | |
| fi | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Coverage summary | |
| run: cargo llvm-cov --all-features --all-targets --summary-only | tee coverage-summary.txt | |
| - name: Upload coverage summary | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage-summary | |
| path: coverage-summary.txt | |
| bench_smoke: | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Benchmark list | |
| run: | | |
| mkdir -p target/bench | |
| cargo bench --all-features -- --list | tee target/bench/bench-list.txt | |
| - name: Install hyperfine | |
| run: sudo apt-get update && sudo apt-get install -y hyperfine | |
| - name: Hyperfine report | |
| run: RUNS=10 ./scripts/bench.sh | |
| - name: Upload benchmark artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: benchmark-artifacts | |
| path: | | |
| target/bench/bench-list.txt | |
| target/bench/hyperfine.md | |
| target/criterion |