fixes clippy warning #36
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: Rust | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
toolchain: | |
- stable | |
- 1.74.0 | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy && rustup component add rustfmt | |
- name: Build | |
run: cargo build --verbose | |
- name: Clippy | |
run: cargo clippy --verbose --all-targets --all-features -- -D warnings | |
- name: fmt | |
run: cargo fmt --all -- --check | |
- name: doc | |
run: cargo doc | |
- name: Run tests (default features) | |
run: cargo test --verbose | |
- name: Run tests (no default features) | |
run: cargo test --verbose --no-default-features | |
- name: Run tests (all features) [chrono time rand serde rocket schemars] | |
run: cargo test --verbose --no-default-features --features "chrono time rand serde rocket schemars" | |
- name: Run tests [rand] | |
run: cargo test --verbose --no-default-features --features "rand" | |
- name: Run tests [chrono] | |
run: cargo test --verbose --no-default-features --features "chrono" | |
- name: Run tests [time] | |
run: cargo test --verbose --no-default-features --features "time" | |
- name: Run tests [serde] | |
run: cargo test --verbose --no-default-features --features "serde" | |
- name: Run tests [schemars] | |
run: cargo test --verbose --no-default-features --features "schemars" | |
- name: Run tests [rocket] | |
run: cargo test --verbose --no-default-features --features "rocket" | |
- name: Run tests [chrono rand serde] | |
run: cargo test --verbose --no-default-features --features "chrono rand serde" | |
- name: Run tests [time rand serde] | |
run: cargo test --verbose --no-default-features --features "time rand serde" | |
coverage: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy && rustup component add rustfmt | |
- name: Run tests (all features) [chrono time rand serde rocket schemars] | |
run: cargo test --verbose --no-default-features --features "chrono time rand serde rocket schemars" | |
env: | |
CARGO_INCREMENTAL: "0" | |
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | |
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" | |
- name: rust-grcov | |
uses: actions-rs/grcov@v0.1.5 | |
- name: Codecov | |
uses: codecov/codecov-action@v3.1.1 | |
with: | |
# Repository upload token - get it from codecov.io. Required only for private repositories | |
# token: # optional | |
# Specify whether the Codecov output should be verbose | |
verbose: true | |
fail_ci_if_error: false |