ci: add fmt and clippy to ci workflow #21
Workflow file for this run
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: Main Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: $(cat rust-toolchain) | |
components: rustfmt, clippy | |
- name: Compile | |
run: cargo test --no-run | |
- name: Test | |
run: cargo test --all --verbose --no-fail-fast | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: $(cat rust-toolchain) | |
components: rustfmt, clippy | |
- name: Run clippy | |
run: cargo clippy --all-features --all-targets -- -D warnings | |
cargo-fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: $(cat rust-toolchain) | |
components: rustfmt, clippy | |
- name: Run rustfmt | |
run: cargo fmt --all --check | |
taplo-fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: $(cat rust-toolchain) | |
components: rustfmt, clippy | |
- name: Install taplo-cli | |
run: cargo install --force --git https://github.com/tamasfe/taplo taplo-cli --no-default-features | |
- name: taplo fmt | |
run: taplo fmt --check |