Use dtolnay/rust-toolchain instead of actions-rs. #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md | |
on: | |
push: | |
branches: | |
- main | |
- staging | |
- trying | |
pull_request: | |
name: Tests | |
jobs: | |
no_std: | |
name: Ensure no_std | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- 1.53.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: rustc --manifest-path=check_no_std/Cargo.toml -- -C link-arg=-nostartfiles | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- 1.53.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: cargo check | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- 1.53.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: cargo test | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
components: rustfmt | |
toolchain: stable | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
components: clippy | |
toolchain: stable | |
- run: cargo clippy -- -D warnings | |
ci-success: | |
name: ci | |
if: ${{ success() }} | |
needs: | |
- no_std | |
- check | |
- test | |
- fmt | |
- clippy | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: CI succeeded | |
run: exit 0 |