watchexec/.github/workflows/clippy.yml
dependabot[bot] a6e0b3f70a
Bump actions/cache from 3 to 4 (#772)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-20 16:42:55 +12:00

62 lines
1.4 KiB
YAML

name: Clippy
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags-ignore:
- "*"
env:
CARGO_TERM_COLOR: always
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
clippy:
strategy:
fail-fast: false
matrix:
platform:
- ubuntu
- windows
- macos
name: Clippy on ${{ matrix.platform }}
runs-on: "${{ matrix.platform }}-latest"
steps:
- uses: actions/checkout@v4
- name: Configure toolchain
run: |
rustup toolchain install stable --profile minimal --no-self-update --component clippy
rustup default stable
# https://github.com/actions/cache/issues/752
- if: ${{ runner.os == 'Windows' }}
name: Use GNU tar
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- name: Configure caching
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Clippy
run: cargo clippy -- $(cat .clippy-lints | tr -d '\r' | xargs)
shell: bash