on:
push:
env:
CARGO_TERM_COLOR: always
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Nightly
run: rustup default nightly
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-sort
- name: Sort
run: cargo sort --check
- name: Format
run: |
rustup component add rustfmt
cargo fmt --check
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-audit
locked: false
- name: Audit
run: cargo audit
- name: Check
run: cargo check
- name: Clippy
run: |
rustup component add clippy
cargo clippy --tests -- --deny warnings
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-udeps
- name: Dependencies
run: cargo udeps
- name: Test
run: cargo test
- uses: taiki-e/cache-cargo-install-action@v1
with:
tool: cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true