Rust Tests #1122
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
name: Rust Tests | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
inputs: | |
git-ref: | |
description: Git Ref (Optional) | |
required: false | |
jobs: | |
# Check rustfmt | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: rustfmt | |
- run: sh ./fmt.sh | |
# Check clippy. This doesn't check ARM though. | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: clippy | |
- run: sh ./clippy.sh | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, nightly, "1.70"] | |
steps: | |
- uses: actions/checkout@v4 | |
if: github.event.inputs.git-ref == '' | |
- uses: actions/checkout@v4 | |
if: github.event.inputs.git-ref != '' | |
with: | |
ref: ${{ github.event.inputs.git-ref }} | |
- name: Install Toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Run syntax check | |
run: cargo build --workspace --all-features | |
- name: Tests | |
run: cargo test --workspace --all-features --no-fail-fast | |
env: | |
RUST_BACKTRACE: full |