Skip to content

Commit 347d643

Browse files
MegaRedHandclaude
andcommitted
ci: add linter and tests check
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 557381d commit 347d643

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["**"]
8+
workflow_dispatch:
9+
10+
# Cancel in-progress runs when a new commit is pushed to the same PR or branch
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
env:
16+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
17+
CARGO_NET_RETRY: "10"
18+
19+
jobs:
20+
lint:
21+
name: Lint
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Setup Rust
27+
uses: dtolnay/rust-toolchain@master
28+
with:
29+
toolchain: "1.92.0"
30+
components: rustfmt, clippy
31+
32+
- name: Setup cache
33+
uses: Swatinem/rust-cache@v2
34+
35+
- name: Check formatting
36+
run: cargo fmt --all -- --check
37+
38+
- name: Cargo check
39+
run: cargo check --workspace --all-targets
40+
41+
- name: Clippy
42+
run: cargo clippy --workspace --all-targets -- -D warnings
43+
44+
test:
45+
name: Test
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Setup Rust
51+
uses: dtolnay/rust-toolchain@master
52+
with:
53+
toolchain: "1.92.0"
54+
55+
- name: Setup cache
56+
uses: Swatinem/rust-cache@v2
57+
58+
- name: Run tests
59+
run: cargo test --workspace

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "1.92.0"
3+
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)