2021-10-04 17:08:19 +08:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
2022-05-03 03:41:13 +08:00
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
2021-10-04 17:08:19 +08:00
|
|
|
|
|
|
|
env:
|
2022-05-03 03:41:13 +08:00
|
|
|
CARGO_TERM_COLOR: always
|
2021-10-04 17:08:19 +08:00
|
|
|
|
|
|
|
jobs:
|
2022-05-03 03:41:13 +08:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust:
|
|
|
|
- stable
|
|
|
|
- nightly
|
|
|
|
- 1.51.0 # MSVR
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
# Important preparation step: override the latest default Rust version in GitHub CI
|
|
|
|
# with the current value of the iteration in the "strategy.matrix.rust"-array.
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: default
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --all-targets --verbose --features all
|
|
|
|
# use some arbitrary no_std target
|
|
|
|
- name: Install no_std target thumbv7em-none-eabihf
|
|
|
|
run: rustup target add thumbv7em-none-eabihf
|
|
|
|
- name: Build (no_std)
|
|
|
|
run: cargo build --verbose --target thumbv7em-none-eabihf --features all
|
|
|
|
- name: Run tests
|
|
|
|
run: cargo test --verbose --features all
|
2021-10-04 17:08:19 +08:00
|
|
|
|
2022-05-03 03:41:13 +08:00
|
|
|
style_checks:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
rust:
|
|
|
|
- stable
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
# Important preparation step: override the latest default Rust version in GitHub CI
|
|
|
|
# with the current value of the iteration in the "strategy.matrix.rust"-array.
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: default
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
|
|
|
- name: Rustfmt
|
|
|
|
run: cargo fmt -- --check
|
|
|
|
- name: Clippy
|
|
|
|
run: cargo clippy --features all
|
|
|
|
- name: Rustdoc
|
|
|
|
run: cargo doc --features all
|