-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 1.78 KB
/
Copy pathci.yml
File metadata and controls
70 lines (59 loc) · 1.78 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
name: Continuous Integration
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build-and-test:
runs-on: ubuntu-latest
name: "🧪 Build & Run Safety Suite"
steps:
- uses: actions/checkout@v4
- name: "🦀 Set up Rust"
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy, rustfmt
- name: "🐍 Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: "🧱 Install dependencies"
run: |
python -m pip install --upgrade pip
python -m pip install maturin pytest black ruff mypy
python -m pip install -e .[dev,training]
- name: "⚙️ Build Rust extension (develop mode)"
run: |
maturin develop --release
- name: "🧹 Lint and format check"
run: |
cargo fmt -- --check
cargo clippy -- -D warnings
black --check python/
ruff check python/
mypy python/
- name: "🧪 Run Safety Test Suite"
env:
PYTHONPATH: ./python
run: |
echo "Running pytest safety checks..."
pytest -v python/tests/test_safety.py
- name: "✅ Summary"
if: success()
run: echo "✅ All safety and CI checks passed."
- name: "❌ Failure notice"
if: failure()
run: echo "❌ Safety suite failed. Blocking release."
test:
runs-on: ubuntu-latest
name: "🧪 Python Tests (uv)"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Install dependencies
run: uv sync --group dev --group training
- name: Run tests
run: uv run pytest -q python