name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: lint-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
clippy:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
features: ["", encryption]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
- name: Install Rust toolchain
run: rustup show
- name: Cache cargo
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: lint-${{ runner.os }}-${{ matrix.features }}-${{ hashFiles('**/Cargo.lock') }}
- name: Clippy
shell: bash
run: |
if [ -n "${{ matrix.features }}" ]; then
cargo clippy --all-targets --features ${{ matrix.features }} -- -D warnings
else
cargo clippy --all-targets -- -D warnings
fi
- name: Rustfmt
run: cargo fmt --all -- --check