Skip to content

Commit c7d0705

Browse files
committed
chore: Add CI checks
1 parent a5da6b9 commit c7d0705

1 file changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [trunk]
6+
pull_request:
7+
branches: [trunk]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
# Run cargo test
18+
test:
19+
name: Test Suite
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 60
22+
steps:
23+
- name: Checkout sources
24+
uses: actions/checkout@v4
25+
- name: Cache
26+
uses: actions/cache@v4
27+
with:
28+
path: |
29+
~/.cargo/bin/
30+
~/.cargo/registry/index/
31+
~/.cargo/registry/cache/
32+
~/.cargo/git/db/
33+
target/
34+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
35+
- name: Install stable toolchain
36+
uses: dtolnay/rust-toolchain@stable
37+
- name: Run cargo test
38+
run: cargo test
39+
40+
# Run cargo clippy -- -D warnings
41+
clippy_check:
42+
name: Clippy
43+
runs-on: ubuntu-latest
44+
timeout-minutes: 30
45+
steps:
46+
- name: Checkout sources
47+
uses: actions/checkout@v4
48+
- name: Cache
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.cargo/bin/
53+
~/.cargo/registry/index/
54+
~/.cargo/registry/cache/
55+
~/.cargo/git/db/
56+
target/
57+
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
58+
- name: Install stable toolchain
59+
uses: dtolnay/rust-toolchain@stable
60+
with:
61+
components: clippy
62+
- name: Run clippy
63+
run: cargo clippy -- -D warnings
64+
65+
# Run cargo fmt --all -- --check
66+
format:
67+
name: Format
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 30
70+
steps:
71+
- name: Checkout sources
72+
uses: actions/checkout@v4
73+
- name: Install stable toolchain
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
components: rustfmt
77+
- name: Run cargo fmt
78+
run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)