name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [
1.94.0, stable,
beta,
nightly,
]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Test (default)
run: cargo test --verbose
- name: Test (no-std)
run: cargo test --verbose --no-default-features
no_std:
name: No Std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- run: cargo build --verbose --no-default-features --target thumbv6m-none-eabi
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-features
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.94.0
with:
components: rustfmt
- run: cargo fmt --all --check
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo rustdoc -- --cfg docsrs
success:
name: Success
runs-on: ubuntu-latest
needs: [test, no_std, clippy, fmt, doc]
if: always() steps:
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'