tar-no-std/.github/workflows/rust.yml

60 lines
1.7 KiB
YAML

name: Build
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
runs-on:
- windows-latest
- ubuntu-latest
rust:
- stable
- nightly
- 1.60.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 alloc
# 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 alloc
- name: Run tests
run: cargo test --verbose --features alloc
style_checks:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- 1.60.0
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 alloc
- name: Rustdoc
run: cargo doc --no-deps --document-private-items --features alloc