Skip to content

Commit 3c54763

Browse files
committed
ci: overhaul testing workflow
1 parent 3f367c6 commit 3c54763

File tree

3 files changed

+111
-81
lines changed

3 files changed

+111
-81
lines changed

.github/workflows/test_build_release.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

.github/workflows/testing.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
format:
12+
name: Formatting
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- id: checkout
17+
name: Checkout Repository
18+
uses: actions/checkout@v3
19+
20+
- id: setup
21+
name: Setup Toolchain
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
toolchain: nightly
25+
components: rustfmt
26+
27+
- id: cache
28+
name: Enable Workflow Cache
29+
uses: Swatinem/rust-cache@v2
30+
31+
- id: format
32+
name: Run Formatting-Checks
33+
run: cargo fmt --check
34+
35+
check:
36+
name: Static Analysis
37+
runs-on: ubuntu-latest
38+
needs: format
39+
40+
strategy:
41+
matrix:
42+
toolchain: [stable, nightly]
43+
44+
steps:
45+
- id: checkout
46+
name: Checkout Repository
47+
uses: actions/checkout@v3
48+
49+
- id: setup
50+
name: Setup Toolchain
51+
uses: dtolnay/rust-toolchain@stable
52+
with:
53+
toolchain: nightly
54+
components: clippy
55+
56+
- id: cache
57+
name: Enable Workflow Cache
58+
uses: Swatinem/rust-cache@v2
59+
60+
- id: check
61+
name: Run Build Checks
62+
run: cargo check --workspace --all-targets --all-features
63+
64+
- id: lint
65+
name: Run Lint Checks
66+
run: cargo clippy --workspace --all-targets --all-features -- -D clippy::correctness -D clippy::suspicious -D clippy::complexity -D clippy::perf -D clippy::style -D clippy::pedantic
67+
68+
- id: doc
69+
name: Run Documentation Checks
70+
run: cargo test --doc
71+
72+
unit:
73+
name: Units
74+
runs-on: ubuntu-latest
75+
needs: check
76+
77+
strategy:
78+
matrix:
79+
toolchain: [stable, nightly]
80+
81+
steps:
82+
- id: checkout
83+
name: Checkout Repository
84+
uses: actions/checkout@v3
85+
86+
- id: setup
87+
name: Setup Toolchain
88+
uses: dtolnay/rust-toolchain@stable
89+
with:
90+
toolchain: ${{ matrix.toolchain }}
91+
components: llvm-tools-preview
92+
93+
- id: cache
94+
name: Enable Job Cache
95+
uses: Swatinem/rust-cache@v2
96+
97+
- id: tools
98+
name: Install Tools
99+
uses: taiki-e/install-action@v2
100+
with:
101+
tool: cargo-llvm-cov, cargo-nextest
102+
103+
- id: test
104+
name: Run Unit Tests
105+
run: cargo test --workspace --all-targets --all-features
106+
107+
- id: coverage
108+
name: Generate Coverage Report
109+
run: cargo llvm-cov nextest --workspace --all-targets --all-features

cSpell.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@
3737
"hlocalhost",
3838
"Hydranode",
3939
"Icelake",
40+
"imdl",
4041
"incompletei",
4142
"infohash",
4243
"infohashes",
4344
"infoschema",
45+
"Intermodal",
4446
"intervali",
4547
"lcov",
4648
"leecher",

0 commit comments

Comments
 (0)