chore: define lints in Cargo.toml instead of each crate's lib.rs #466
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: Rust | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
- name: Run cargo check | |
run: cargo check --all-targets | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
bins: cargo-nextest,just | |
- name: Download Prophet Stan model | |
# Download the Prophet Stan model since an example requires it. | |
run: just download-prophet-stan-model | |
- name: Run cargo nextest | |
run: just test-all | |
- name: Run doc tests | |
run: just doctest | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
components: rustfmt | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: moonrepo/setup-rust@v1 | |
with: | |
components: clippy | |
- name: Run cargo clippy | |
run: cargo clippy -- -D warnings |