-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
75 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,99 @@ | ||
on: [push, pull_request] | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- ci | ||
pull_request: | ||
|
||
name: Continuous integration | ||
|
||
jobs: | ||
check: | ||
rustfmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check | ||
run: cargo check --all-features --workspace --bins --examples --tests | ||
- name: Nightly Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- name: Format | ||
- name: Rustfmt | ||
run: cargo fmt -- --check | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Stable Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- name: Clippy | ||
run: cargo clippy --all-features --workspace --bins --examples --tests -- -D warnings | ||
run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Stable Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Test | ||
run: cargo test --all-features --workspace --bins --examples --tests | ||
- name: Test all targets | ||
run: cargo test --all-targets --all-features | ||
|
||
- name: Test docs | ||
run: cargo test --doc | ||
|
||
typos: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Check typos | ||
uses: crate-ci/typos@master | ||
with: | ||
files: . | ||
|
||
cargo_sort: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Stable Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Install `typos` | ||
uses: actions-rs/[email protected] | ||
- name: Install cargo-sort | ||
run: cargo install --locked cargo-sort | ||
|
||
- name: Check `Cargo.toml` sort | ||
run: cargo sort -c | ||
|
||
machete: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Stable Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
crate: typos-cli | ||
version: latest | ||
toolchain: stable | ||
|
||
- name: Install `cargo-machete` | ||
run: cargo install --locked cargo-machete | ||
|
||
- name: Any typos? | ||
run: typos | ||
- name: Check unused Cargo dependencies | ||
run: cargo machete |