Add lint checks & change actions-rs/toolchain to dtolnay/rust-toolchain

This commit is contained in:
Adam Perkowski 2024-07-19 18:22:21 +02:00
parent 9403f30157
commit 65c4fd2fec
No known key found for this signature in database
GPG Key ID: 7CBDB58ECF1D3478
2 changed files with 19 additions and 9 deletions

View File

@ -30,9 +30,7 @@ jobs:
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-index- restore-keys: ${{ runner.os }}-cargo-index-
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build - name: Build
run: cargo build --target-dir=build --release --verbose run: cargo build --target-dir=build --release --verbose
- uses: stefanzweifel/git-auto-commit-action@v5 - uses: stefanzweifel/git-auto-commit-action@v5

View File

@ -1,4 +1,4 @@
name: Rust Check name: Rust Checks
on: on:
pull_request: pull_request:
@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout sources
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Cache Cargo registry - name: Cache Cargo registry
uses: actions/cache@v4 uses: actions/cache@v4
@ -26,8 +27,19 @@ jobs:
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-index- restore-keys: ${{ runner.os }}-cargo-index-
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build - name: Build
run: cargo check run: cargo check
lints:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run cargo fmt
run: cargo --fmt --all check
- name: Run cargo clippy
run: cargo clippy