Skip to content

Commit 22f0d1a

Browse files
committed
ci: Add basic CI workflow
ci: Run all checks
1 parent de07509 commit 22f0d1a

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test:
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest, macos-latest, windows-latest]
23+
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
steps:
29+
- uses: actions/checkout@v6
30+
31+
- name: Setup Rust toolchain
32+
uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561
33+
id: rust-toolchain
34+
with:
35+
toolchain: "1.93"
36+
components: rustfmt, clippy
37+
38+
- name: Install nextest
39+
uses: taiki-e/install-action@nextest
40+
41+
- name: Cache
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
~/.cargo/bin/
46+
~/.cargo/registry/index/
47+
~/.cargo/registry/cache/
48+
~/.cargo/git/db/
49+
target/
50+
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }}
51+
52+
- name: Format
53+
run: cargo fmt -- --check
54+
55+
- name: Clippy
56+
run: cargo clippy --workspace --all-targets -- -D warnings
57+
58+
- name: Clippy / all-features
59+
run: cargo clippy --all-features --all-targets -- -Dclippy::all -Dunused_imports -Dclippy::uninlined-format-args
60+
61+
- name: Run tests
62+
run: cargo nextest run --all-targets --no-fail-fast

0 commit comments

Comments
 (0)