Skip to content

Commit 5e896ca

Browse files
committed
ubuntu
1 parent dfd1d4c commit 5e896ca

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,46 @@ env:
1414

1515
jobs:
1616
build:
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818

1919
steps:
2020
- uses: actions/checkout@v3
2121

22-
# Install Rust toolchain
23-
- name: Install Rust
22+
# Install Rust
23+
- name: Install Rust toolchain
2424
run: rustup toolchain install stable
2525

26-
# Run Clippy (Rust linter)
26+
# Run Clippy
2727
- name: Run Clippy
2828
run: rustup component add clippy && cargo clippy -- -D warnings
2929

30-
# Setup Python virtual environment and run Python lint/tests
31-
- name: Setup Python and run tests
30+
# Install Python dependencies for PyO3
31+
- name: Setup Python
3232
run: |
33-
python -m venv venv
33+
sudo apt-get update
34+
sudo apt-get install -y python3-dev python3-venv python3-pip
35+
python3 -m venv venv
3436
source venv/bin/activate
3537
pip install --upgrade pip
36-
pip install ruff maturin
38+
pip install maturin ruff
3739
ruff check .
40+
41+
# Build Rust extension in develop mode
42+
- name: Build Python extension
43+
run: |
44+
source venv/bin/activate
3845
maturin develop
39-
python -m unittest discover -s tests -p '*.py'
4046
41-
# Build Rust with PyO3
42-
- name: Build Rust
47+
# Run Python tests
48+
- name: Run Python unittests
4349
run: |
4450
source venv/bin/activate
45-
export PYTHON_SYS_EXECUTABLE=$(which python)
46-
cargo build --verbose
51+
python -m unittest discover -s tests -p '*.py'
52+
53+
# Build Rust normally
54+
- name: Build Rust
55+
run: cargo build --verbose
4756

4857
# Run Rust tests with all features (including PyO3)
4958
- name: Run Rust tests
50-
run: |
51-
source venv/bin/activate
52-
export PYTHON_SYS_EXECUTABLE=$(which python)
53-
cargo test --all-features --verbose
59+
run: cargo test --all-features --verbose

0 commit comments

Comments
 (0)