name: CI
on:
push:
branches:
- main
- nightly
pull_request:
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [stable, beta, nightly]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install cargo-hack
run: cargo install cargo-hack
- name: Install cargo-semver-checks
if: matrix.rust == 'stable'
uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks
- name: Check (Compilation)
run: RUSTFLAGS="-D warnings" cargo hack check --feature-powerset --all-targets
- name: Run Tests
run: cargo hack test --feature-powerset --lib
- name: Run Doc Tests
run: cargo test --doc --all-features
- name: Check Formatting
if: matrix.rust == 'stable'
run: cargo fmt --all -- --check
- name: Lint
if: matrix.rust == 'stable'
run: RUSTFLAGS="-D warnings" cargo hack clippy --feature-powerset --all-targets
- name: Check SemVer Violation
if: matrix.rust == 'stable'
run: cargo semver-checks check-release
- name: Install thumbv7em-none-eabihf Target
run: rustup target add thumbv7em-none-eabihf
- name: Check no_std Compliance (Ad-Hoc for Now)
run: |
cargo hack b \
--feature-powerset \
--exclude-features std,default \
--target thumbv7em-none-eabihf