84 lines
2.3 KiB
YAML
84 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: '0 2 * * *'
|
|
|
|
env:
|
|
RUSTFLAGS: -D warnings
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
rust: [nightly, beta, stable]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust
|
|
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
|
|
- run: cargo build --all --all-features --all-targets
|
|
- name: Run cargo check (without dev-dependencies to catch missing feature flags)
|
|
if: startsWith(matrix.rust, 'nightly')
|
|
run: cargo check -Z features=dev_dep
|
|
- run: cargo test
|
|
- name: Install cargo-hack
|
|
uses: taiki-e/install-action@cargo-hack
|
|
- run: rustup target add thumbv7m-none-eabi
|
|
- run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps
|
|
|
|
msrv:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
# When updating this, the reminder to update the minimum supported
|
|
# Rust version in Cargo.toml.
|
|
rust: ['1.36']
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust
|
|
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
|
|
- run: cargo build
|
|
|
|
clippy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust
|
|
run: rustup update stable
|
|
- run: cargo clippy --all-features --all-targets
|
|
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust
|
|
run: rustup update stable
|
|
- run: cargo fmt --all --check
|
|
|
|
miri:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Rust
|
|
run: rustup toolchain install nightly --component miri && rustup default nightly
|
|
- run: cargo miri test
|
|
env:
|
|
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
|
|
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
|
|
|
|
security_audit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions-rs/audit-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|