name: CI
on:
- push
- pull_request
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: ${{ github.event_name == 'pull_request' ||
(github.ref != 'refs/heads/main' &&
!startsWith(github.ref, 'refs/tags/')) }}
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
channel:
- stable
- beta
- nightly
steps:
- name: Configure git
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
git config --global fetch.parallel 32
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy --all-features -- -D warnings
- name: Install cargo-all-features
run: cargo install cargo-featurex
- name: Run check (all feature permutations)
run: cargo featurex clippy
- name: Run tests (all feature permutations)
run: cargo featurex test