-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (90 loc) · 2.59 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 5 * * 0"
env:
LOG_LEVEL: debug
CARGO_TERM_COLOR: always
MIN_LINE_COVERAGE_TARGET: 80
jobs:
Project-Config:
runs-on: ubuntu-24.04
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Setup Taplo
uses: taiki-e/install-action@v2
with:
tool: taplo-cli
- name: Install yamlfmt
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest
- name: Verify Project Config
run: cargo verify-project --verbose
- name: Verify YAML Files Format
run: yamlfmt --lint .
- name: Verify TOML Files Format
run: taplo fmt --check --verbose --diff
Docs:
runs-on: ubuntu-24.04
needs: Project-Config
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build Crate Doc
run: cargo doc --workspace --all-features --document-private-items --verbose
- name: Doc Tests
run: cargo test --workspace --all-features --doc
Build:
runs-on: ubuntu-24.04
needs: Project-Config
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
- name: Format
run: cargo fmt --all --check
- name: Lints
run: cargo clippy --workspace --all-features
- name: Build
run: cargo build --workspace --all-features
Tests:
runs-on: ubuntu-24.04
needs: Build
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Setup cargo-llvm-cov
uses: taiki-e/[email protected]
with:
tool: cargo-llvm-cov,cargo-nextest
- name: Unit & Integration Tests
run: cargo llvm-cov nextest --workspace --all-features --show-missing-lines --summary-only --fail-under-lines ${{ env.MIN_LINE_COVERAGE_TARGET }}
Security:
runs-on: ubuntu-24.04
needs: Build
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Security Analysis
uses: EmbarkStudios/cargo-deny-action@v1
with:
log-level: ${{ env.LOG_LEVEL }}
command: check