blob: 3430ad1b9c45876f9de7a78b2ae981bc0ce5c3ff [file] [log] [blame]
name: CI
permissions:
contents: read
on:
pull_request:
paths-ignore:
- README.md
push:
branches: main
paths-ignore:
- README.md
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly-2022-01-01
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- run: cargo build --release --workspace
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly-2022-01-01
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
with:
submodules: true
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- run: cargo test --workspace -- --nocapture
no_std:
name: Build for a no_std target
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly-2022-01-01
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
target: thumbv6m-none-eabi
override: true
- run: cargo build --release --workspace --target thumbv6m-none-eabi
msrv:
name: Rust ${{matrix.rust}} MSRV
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.56.0, 1.57.0]
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
with:
submodules: true
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- run: rustc --version
- run: cargo build --release --workspace --all-features
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2
- run: go get github.com/campoy/embedmd
- uses: actions/setup-ruby@b007fae6f1ffbe3a51c00a6df6f5ff01184d5340 # v1
- run: gem install mdl
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: nightly-2022-01-01
override: true
components: rustfmt
- run: cargo fmt --all -- --check
- run: scripts/check-format.sh
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: nightly-2022-01-01
override: true
components: rustfmt, clippy
- run: cargo clippy --all-features --all-targets
- run: git diff --exit-code
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: stable
- run: RUSTDOCFLAGS="-Dwarnings" cargo doc --no-deps --document-private-items
udeps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: nightly-2022-01-01
override: true
components: rustfmt
- uses: actions-rs/install@69ec87709ffb5b19a7b5ddbf610cb221498bb1eb # v0.1.2
with:
crate: cargo-udeps
use-tool-cache: true
version: 0.1.25
- run: cargo udeps
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: nightly-2022-01-01
override: true
components: rustfmt
- run: cargo install --locked --version 0.8.5 cargo-deny
- run: cargo deny check
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
with:
submodules: true
fetch-depth: 0
- uses: actions-rs/toolchain@63eb9591781c46a70274cb3ebdf190fce92702e8 # v1
with:
profile: minimal
toolchain: nightly-2022-01-01
override: true
components: rustfmt
- uses: actions-rs/install@69ec87709ffb5b19a7b5ddbf610cb221498bb1eb # v0.1.2
with:
crate: cargo-tarpaulin
use-tool-cache: true
- run: cargo tarpaulin --verbose --ignore-tests --all-features --timeout=600 --out Xml
- name: Upload to codecov.io
run: |
bash <(curl -s https://codecov.io/bash)