@@ -2,11 +2,13 @@ name: Continuous Integration
22
33on :
44 push :
5- branches : [master]
5+ branches :
6+ - master
67 pull_request :
78 types : [opened, synchronize, reopened]
89
910permissions : read-all
11+
1012env :
1113 CARGO_TERM_COLOR : always
1214
@@ -15,41 +17,45 @@ jobs:
1517 runs-on : ubuntu-latest
1618
1719 steps :
20+ # Checkout code
1821 - uses : actions/checkout@v3
1922
20- # Install Rust
23+ # Install Rust toolchain
2124 - name : Install Rust toolchain
2225 run : rustup toolchain install stable
2326
24- # Clippy (all features including PyO3)
27+ # Clippy - Rust linter
2528 - name : Run Clippy
26- run : cargo clippy --all-targets --all-features -- -D warnings
29+ run : |
30+ rustup component add clippy
31+ cargo clippy -- -D warnings
32+
33+ # Install Python dev headers (needed for PyO3)
34+ - name : Install Python dev dependencies
35+ run : sudo apt-get update && sudo apt-get install -y python3-dev python3-venv
2736
28- # Setup Python environment
29- - name : Setup Python
37+ # Setup Python virtual environment
38+ - name : Setup Python environment
3039 run : |
31- python -m venv venv
40+ python3 -m venv venv
3241 source venv/bin/activate
33- pip install --upgrade pip setuptools maturin ruff
42+ pip install --upgrade pip
3443
35- # Lint Python
36- - name : Lint Python
44+ # Python linting
45+ - name : Python linting
3746 run : |
3847 source venv/bin/activate
48+ pip install ruff
3949 ruff check .
4050
41- # Build PyO3 extension
42- - name : Build PyO3 extension
51+ # Build and test PyO3 extension + Python tests using maturin
52+ - name : Build and test Rust + PyO3
4353 run : |
4454 source venv/bin/activate
55+ pip install maturin
4556 maturin develop --release
57+ maturin test --release
4658
47- # Run Python tests
48- - name : Python tests
49- run : |
50- source venv/bin/activate
51- python -m unittest discover -s tests -p '*.py'
52-
53- # Run Rust tests with all features
54- - name : Rust tests
55- run : cargo test --all-features --verbose
59+ # Optional: build Rust without Python (for pure Rust CI)
60+ - name : Build Rust only
61+ run : cargo build --verbose
0 commit comments