Skip to content

Commit dfff288

Browse files
authored
Merge pull request #182 from gwen-lg/ci_add_checks
add checks in rust workflow
2 parents d8e97db + 4f6d87c commit dfff288

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/checks.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: checks
2+
env:
3+
CARGO_TERM_COLOR: always
4+
RUSTFLAGS: -D warnings
5+
6+
on:
7+
push:
8+
pull_request:
9+
10+
jobs:
11+
formatting:
12+
name: Rust formatting
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: Swatinem/rust-cache@v2
17+
- uses: dtolnay/rust-toolchain@stable
18+
with:
19+
toolchain: stable
20+
- name: Rust formatting
21+
run: cargo fmt --all --check
22+
23+
rust_checks:
24+
name: Rust checks (clippy, doc)
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: Swatinem/rust-cache@v2
29+
- uses: dtolnay/rust-toolchain@stable
30+
with:
31+
toolchain: stable
32+
- name: Rust clippy
33+
run: cargo clippy --workspace --profile=test --locked
34+
- name: Rust doc
35+
env:
36+
RUSTDOCFLAGS: "-D warnings"
37+
if: $${{ always() }} # run even if clippy failed
38+
run: cargo doc --workspace --no-deps --locked
39+
- name: Run tests
40+
run: cargo test --verbose --locked
41+
42+
toml:
43+
name: Toml formatting
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: gwen-lg/taplo-action@v1
48+
with:
49+
format: true
50+
51+
spelling:
52+
name: Spell Check with Typos
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout Actions Repository
56+
uses: actions/checkout@v4
57+
- name: Spell Check Repo
58+
uses: crate-ci/typos@v1

0 commit comments

Comments
 (0)