Skip to content

Commit c5b69c8

Browse files
committed
chore: add ci
1 parent 2bb1fd7 commit c5b69c8

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

.github/workflows/ci.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test Suite
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v4
19+
20+
- name: Install toolchain
21+
uses: actions-rust-lang/setup-rust-toolchain@v1
22+
23+
- name: Run cargo test
24+
run: cargo test --all-features --workspace
25+
26+
rustfmt:
27+
name: Rustfmt
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout sources
31+
uses: actions/checkout@v4
32+
33+
- name: Install toolchain
34+
uses: actions-rust-lang/setup-rust-toolchain@v1
35+
with:
36+
components: rustfmt
37+
38+
- name: Run cargo fmt
39+
run: cargo fmt --all -- --check
40+
41+
clippy:
42+
name: Clippy
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout sources
46+
uses: actions/checkout@v4
47+
48+
- name: Install toolchain
49+
uses: actions-rust-lang/setup-rust-toolchain@v1
50+
with:
51+
components: clippy
52+
53+
- name: Run cargo clippy
54+
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
55+
56+
build:
57+
name: Build
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Checkout sources
61+
uses: actions/checkout@v4
62+
63+
- name: Install toolchain
64+
uses: actions-rust-lang/setup-rust-toolchain@v1
65+
66+
- name: Run cargo build
67+
run: cargo build --all-features --workspace
68+
69+
- name: Run cargo build (release)
70+
run: cargo build --release --all-features --workspace
71+
72+
security_audit:
73+
name: Security Audit
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Checkout sources
77+
uses: actions/checkout@v4
78+
79+
- name: Install toolchain
80+
uses: actions-rust-lang/setup-rust-toolchain@v1
81+
82+
- name: Install cargo-audit
83+
run: cargo install cargo-audit
84+
85+
- name: Run cargo audit
86+
run: cargo audit
87+
88+
coverage:
89+
name: Code Coverage
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout sources
93+
uses: actions/checkout@v4
94+
95+
- name: Install toolchain
96+
uses: actions-rust-lang/setup-rust-toolchain@v1
97+
with:
98+
components: llvm-tools-preview
99+
100+
- name: Install cargo-llvm-cov
101+
uses: taiki-e/install-action@cargo-llvm-cov
102+
103+
- name: Generate code coverage
104+
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
105+
106+
- name: Upload coverage to Codecov
107+
uses: codecov/codecov-action@v4
108+
with:
109+
files: lcov.info
110+
fail_ci_if_error: true

0 commit comments

Comments
 (0)