* Fix to not specify the rust toolchain version everywhere * Fix to source * Fix warning about non-portable option to cp * Fix to use built-in Swatinem/rust-cache * Fix Swatinem/rust-cache to use the right directory
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**/Cargo.toml'
|
|
- '**/Cargo.lock'
|
|
- '**/rust-toolchain.toml'
|
|
- '**.rs'
|
|
- .github/workflows/cargo-clippy.yml
|
|
pull_request:
|
|
paths:
|
|
- '**/Cargo.toml'
|
|
- '**/Cargo.lock'
|
|
- '**/rust-toolchain.toml'
|
|
- '**.rs'
|
|
- .github/workflows/cargo-clippy.yml
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
name: cargo clippy
|
|
jobs:
|
|
cargoclippy:
|
|
name: cargo clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: taiki-e/install-action@just
|
|
- name: Use correct Rust toolchain
|
|
shell: bash
|
|
run: |
|
|
cp --update=none rust/rust-toolchain.toml ./ || true
|
|
- name: Install rust
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
with:
|
|
cache-workspaces: rust
|
|
components: clippy
|
|
|
|
- name: Run clippy
|
|
run: |
|
|
cd rust
|
|
just lint
|
|
# If this fails, run "cargo check" to update Cargo.lock,
|
|
# then add Cargo.lock to the PR.
|
|
- name: Check Cargo.lock doesn't need updating
|
|
run: |
|
|
cargo check --locked || echo "Pls run cargo check and commit the changed Cargo.lock"
|