name: CI
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache Rust build artifacts
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
- name: Run tests
run: cargo test --locked --all-targets
- name: Run clippy
run: cargo clippy --locked --all-targets --no-default-features -- -D warnings
- name: Install macFUSE build dependencies
if: runner.os == 'macOS'
run: |
brew install pkgconf
brew install --cask macfuse
- name: Check macFUSE feature build
if: runner.os == 'macOS'
run: cargo check --locked --features macfuse