feat(spellcheck): add spellcheck precommit ci and config #12
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: CI # Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
env: | |
RUSTFLAGS: -Dwarnings | |
RUST_BACKTRACE: 1 | |
rust_stable: stable | |
rust_clippy: "1.80" | |
rust_min: "1.80" | |
jobs: | |
# test: | |
# https://github.com/Owen-CH-Leung/tokio/blob/623e4bb8fc4862f36d08643bd640c085668be054/.github/workflows/ci.yml | |
# Basic actions that must pass before we kick off more expensive tests. | |
basics: | |
name: basic checks | |
runs-on: ubuntu-latest | |
needs: | |
- clippy | |
- fmt | |
- docs | |
- minrust | |
steps: | |
- run: exit 0 | |
minrust: | |
name: minrust | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.rust_min }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.rust_min }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: "check --workspace --all-features" | |
run: cargo check --workspace --all-features | |
env: | |
RUSTFLAGS: "" # remove -Dwarnings | |
fmt: | |
name: fmt | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.rust_stable }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.rust_stable }} | |
components: rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- name: "rustfmt --all --check" | |
run: cargo fmt --all --check | |
clippy: | |
name: clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.rust_clippy }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.rust_clippy }} | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- name: "clippy --all" | |
run: cargo clippy --all --tests --all-features --no-deps --workspace | |
docs: | |
name: docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.rust_stable }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.rust_stable }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Check documentation | |
run: cargo doc --no-deps --document-private-items --all-features --workspace --examples | |
check-spelling: | |
name: check-spelling | |
needs: basics | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust ${{ env.rust_stable }} | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.rust_stable }} | |
- name: Install cargo-spellcheck | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-spellcheck | |
- uses: actions/checkout@v4 | |
- name: Run cargo-spellcheck | |
run: cargo spellcheck --code 1 |