mirror of
https://github.com/sqids/sqids-rust
synced 2024-11-23 03:08:36 +00:00
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
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
|
|
toolchain: stable
|
|
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: |
|
|
rustfmt **/*.rs
|
|
cargo clippy --all -- -D warnings
|
|
- name: Install cargo check tools
|
|
run: |
|
|
cargo install --locked cargo-deny || true
|
|
cargo install --locked cargo-outdated || true
|
|
- name: Check
|
|
run: |
|
|
cargo deny check
|
|
cargo outdated --exit-code 1
|
|
rm -rf ~/.cargo/advisory-db
|
|
- name: Test
|
|
run: cargo test --all |