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

60 lines
1.7 KiB
YAML
Raw Normal View History

2021-10-04 17:08:19 +08:00
name: Build
2023-04-11 16:47:06 +08:00
on: [push, pull_request]
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:
2023-04-11 16:47:06 +08:00
runs-on: ${{ matrix.runs-on }}
2022-05-03 03:41:13 +08:00
strategy:
matrix:
2023-04-11 16:47:06 +08:00
runs-on:
- windows-latest
- ubuntu-latest
2022-05-03 03:41:13 +08:00
rust:
- stable
- nightly
2023-04-11 16:47:06 +08:00
- 1.60.0 # MSVR
2022-05-03 03:41:13 +08:00
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
2023-04-11 16:47:06 +08:00
run: cargo build --all-targets --verbose --features alloc
2022-05-03 03:41:13 +08:00
# 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)
2023-04-11 16:47:06 +08:00
run: cargo build --verbose --target thumbv7em-none-eabihf --features alloc
2022-05-03 03:41:13 +08:00
- name: Run tests
2023-04-11 16:47:06 +08:00
run: cargo test --verbose --features alloc
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:
2023-04-11 16:47:06 +08:00
- 1.60.0
2022-05-03 03:41:13 +08:00
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
2023-04-11 16:47:06 +08:00
run: cargo clippy --features alloc
2022-05-03 03:41:13 +08:00
- name: Rustdoc
2023-04-11 16:47:06 +08:00
run: cargo doc --no-deps --document-private-items --features alloc