forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
202 lines (156 loc) · 6.11 KB
/
Copy pathci.yml
File metadata and controls
202 lines (156 loc) · 6.11 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
# -----------------------------------------------------------------------
# Primary build & test (default features)
# -----------------------------------------------------------------------
test:
name: Build & Test
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y python3-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --all-targets
- name: Test
run: cargo test
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked
- name: Generate coverage report
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload coverage to Codecov
if: env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v5
with:
files: lcov.info
- name: Gate (forbidden patterns + zero warnings)
run: python3 verify_implementation.py
# -----------------------------------------------------------------------
# Release build — catches optimization-only errors
# -----------------------------------------------------------------------
release:
name: Release Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y python3-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build (release)
run: cargo build --release
- name: Test (release)
run: cargo test --release
# -----------------------------------------------------------------------
# No-default-features build — proves zero PyO3/SQLite/LSP dependencies
# -----------------------------------------------------------------------
minimal-build:
name: Build without optional features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
# No python3-dev installed here on purpose: this job proves the
# no-default-features build has zero PyO3/SQLite/LSP dependencies.
- name: Build
run: cargo build --all-targets --no-default-features
- name: Test
run: cargo test --no-default-features
- name: Check zero warnings
run: cargo check --tests --no-default-features
# -----------------------------------------------------------------------
# WASM backend
# -----------------------------------------------------------------------
wasm-backend:
name: Build & Test (wasm-backend feature)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y python3-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --all-targets --features wasm-backend
- name: Test
run: cargo test --features wasm-backend
# -----------------------------------------------------------------------
# Lint — format, clippy, audit, docs, all-features check
# -----------------------------------------------------------------------
lint:
name: Format, Clippy & Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y python3-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@v2
# Format check is blocking — the codebase has been rustfmt'd.
- name: Format check
run: cargo fmt --check
# Clippy with default features — correctness lints are blocking.
- name: Clippy (default features)
run: cargo clippy --all-targets -- -D clippy::correctness
# Clippy with all features — catches wasm-backend code paths.
- name: Clippy (all features)
run: cargo clippy --all-targets --all-features -- -D clippy::correctness
# Clippy with no default features — catches minimal-build code paths.
- name: Clippy (no default features)
run: cargo clippy --all-targets --no-default-features -- -D clippy::correctness
# Zero compiler warnings on the main build path.
- name: Check zero warnings (tests)
run: cargo check --tests
# Security audit of dependency tree.
- name: Audit (cargo-audit)
run: |
cargo install cargo-audit --locked
cargo audit
# All-features compilation check.
- name: Check all features
run: cargo check --all-features
# Documentation builds without errors.
- name: Check docs
run: cargo doc --no-deps
# Documentation warnings are non-blocking but visible.
- name: Doc warnings (info only)
run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps 2>&1 || true
# -----------------------------------------------------------------------
# Lean formalization — verifies the formal specs compile
# -----------------------------------------------------------------------
lean:
name: Lean Formalization
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install elan (Lean toolchain manager)
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:v4.16.0
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Build formal specs
run: |
cd spec/formal
lake build