Skip to content

CI improvements

CI improvements #126

Workflow file for this run

name: Rust
on:
push:
branches: [ master ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ master ]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
build-nostd:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs:
- formatting
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: thumbv7em-none-eabihf
- name: Build no_std
run: cargo build --verbose --target thumbv7em-none-eabihf -Z avoid-dev-deps
tests:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs:
- formatting
strategy:
matrix:
rust:
- stable
- beta
- nightly
- 1.61.0 # MSRV
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Check
run: cargo c --verbose
- name: Check examples
run: cargo c --examples --verbose
- name: Run tests
run: cargo test --verbose --release
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Check doc links
run: |
cargo doc --color=never &> ./out
cat ./out
! grep "^warning:" ./out