specify dylint version #354
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: Verify | |
on: [push] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
toolchain: nightly-2024-02-22 | |
jobs: | |
fmt: | |
name: cargo fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Cargo dependencies and binaries | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo | |
target | |
key: ${{ runner.os }}-cargo-${{ env.toolchain }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ env.toolchain }}- | |
${{ runner.os }}-cargo- | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.toolchain }} | |
components: rustfmt, clippy | |
- name: Install dylint | |
run: | | |
if ! command -v cargo-dylint &> /dev/null || ! command -v dylint-link &> /dev/null; then | |
cargo +stable install [email protected] [email protected] | |
fi | |
- name: cargo fmt --check | |
run: cargo fmt --check | |
clippy: | |
name: cargo clippy | |
env: | |
RUSTFLAGS: -D warnings | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Cargo dependencies and binaries | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
~/.cargo/bin | |
target | |
key: ${{ runner.os }}-cargo-${{ env.toolchain }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ env.toolchain }}- | |
${{ runner.os }}-cargo- | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.toolchain }} | |
components: rustfmt, clippy | |
- name: Install dylint | |
run: | | |
if ! command -v cargo-dylint &> /dev/null || ! command -v dylint-link &> /dev/null; then | |
cargo +stable install [email protected] [email protected] | |
fi | |
- name: cargo clippy | |
run: cargo clippy --lib --all-features | |
test: | |
name: cargo test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Cargo dependencies and binaries | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo | |
target | |
key: ${{ runner.os }}-cargo-${{ env.toolchain }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-${{ env.toolchain }}- | |
${{ runner.os }}-cargo- | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.toolchain }} | |
components: rustfmt, clippy | |
- name: Install dylint | |
run: | | |
if ! command -v cargo-dylint &> /dev/null || ! command -v dylint-link &> /dev/null; then | |
cargo +stable install [email protected] [email protected] | |
fi | |
- name: cargo test | |
run: cargo test --workspace |