2023-07-18 18:19:47 +00:00
|
|
|
name: tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
2023-07-18 19:13:05 +00:00
|
|
|
toolchain: stable
|
2023-07-18 18:19:47 +00:00
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
- name: Set up cargo cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
continue-on-error: false
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
restore-keys: ${{ runner.os }}-cargo-
|
|
|
|
- name: Lint
|
|
|
|
run: |
|
2023-07-18 18:57:06 +00:00
|
|
|
rustfmt **/*.rs
|
2023-07-18 18:54:58 +00:00
|
|
|
cargo clippy --all -- -D warnings
|
2023-07-18 18:19:47 +00:00
|
|
|
- name: Install cargo check tools
|
|
|
|
run: |
|
2023-07-18 18:57:06 +00:00
|
|
|
cargo install --locked cargo-deny || true
|
2023-07-18 18:19:47 +00:00
|
|
|
cargo install --locked cargo-outdated || true
|
|
|
|
cargo install --locked cargo-udeps || true
|
|
|
|
- name: Check
|
|
|
|
run: |
|
2023-07-18 18:57:06 +00:00
|
|
|
cargo deny check
|
2023-07-18 18:19:47 +00:00
|
|
|
cargo outdated --exit-code 1
|
|
|
|
cargo udeps
|
|
|
|
rm -rf ~/.cargo/advisory-db
|
|
|
|
- name: Test
|
|
|
|
run: cargo test --all
|