Fix clippy errors and some warnings #159
This file contains 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: [pull_request, push] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
build: | |
- stable | |
include: | |
- build: stable | |
os: ubuntu-latest | |
rust: stable | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: Basic build | |
run: cargo build --all --locked --verbose | |
- name: Test package | |
run: cargo test --all --locked --verbose | |
proptest: | |
name: proptest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run proptests | |
run: cargo test --all --release --locked proptest -- --ignored | |
rustfmt: | |
name: rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
clippy: | |
name: clippy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
checks: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Clippy linting | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all --all-features | |
codecov: | |
name: codecov | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Coverage for regular tests | |
run: cargo llvm-cov --locked --all --all-features --no-report --release | |
- name: Coverage for proptests | |
run: cargo llvm-cov --locked --all --all-features --no-report --release -- proptest --ignored | |
- name: Report code coverage | |
run: cargo llvm-cov report --release --codecov --output-path codecov.json | |
- name: Upload report to codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
fail_ci_if_error: true |