name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install rustfmt
run: rustup component add rustfmt
- name: Run rustfmt and check there's no difference
run: cargo fmt --all -- --check
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build
- name: Run tests
run: cargo test --all --all-features --verbose
features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check with all features
run: cargo check --all-features
no_std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install thumbv6m-none-eabi target
run: rustup target add thumbv6m-none-eabi
- name: Check no_std build
run: cargo check --target thumbv6m-none-eabi --no-default-features --features trace-log,checker,enable-serde
cargo_deny:
name: Cargo deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: cargo install cargo-deny
- run: cargo deny check
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install nightly
run: rustup toolchain install nightly
- name: Install cargo-fuzz
run: cargo +nightly install cargo-fuzz
- name: Build all fuzz targets
run: cargo +nightly fuzz build