ci: create CI workflow with lint job
Swadhin Biswas committed 7 months ago
ba5daa9
1 parent 390dbf2
commit ba5daa9
1 file changed
+30 -0
Showing 1 changed file+30-0
▼.github/workflows/ci.yml
+30-0
| @@ -0,0 +1,30 @@ | ||
1 | +name: CI | |
2 | + | |
3 | +on: | |
4 | + push: | |
5 | + branches: [main, master, dev] | |
6 | + pull_request: | |
7 | + branches: [main, master] | |
8 | + | |
9 | +env: | |
10 | + CARGO_TERM_COLOR: always | |
11 | + RUSTFLAGS: "-Dwarnings" | |
12 | + | |
13 | +jobs: | |
14 | + # ── Lint ───────────────────────────────────────────────────────────────────── | |
15 | + lint: | |
16 | + name: Lint & Format | |
17 | + runs-on: ubuntu-latest | |
18 | + steps: | |
19 | + - uses: actions/checkout@v4 | |
20 | + | |
21 | + - name: Install Rust toolchain | |
22 | + uses: dtolnay/rust-toolchain@stable | |
23 | + with: | |
24 | + components: rustfmt, clippy | |
25 | + | |
26 | + - name: Cache cargo registry & build | |
27 | + uses: actions/cache@v4 | |
28 | + with: | |
29 | + path: | | |
30 | + ~/.cargo/registry | |
0 | 31 | |