Skip to content

Commit 0b56a1b

Browse files
committed
install python dependencies with maturin develop and then run cargo test after build
1 parent f1ea37c commit 0b56a1b

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,28 @@ jobs:
6161
python-version: "3.12" # Use a stable Python version for building
6262
cache: ${{ matrix.platform.is_musl != true && 'pip' || '' }}
6363

64-
# Run Rust tests before building
65-
- name: Run cargo tests
66-
if: ${{ !matrix.platform.is_musl }}
67-
run: cargo test --no-default-features
68-
shell: bash
69-
70-
- name: Build wheels
64+
- name: Build wheels and run development install
7165
uses: PyO3/maturin-action@v1
7266
with:
7367
target: ${{ matrix.platform.target }}
74-
args: --release --out dist --find-interpreter
68+
command: |
69+
# First build wheels
70+
maturin build --release --out dist --find-interpreter
71+
# Then do a development install if not musl and not skipping tests
72+
if [[ "${{ matrix.platform.is_musl }}" != "true" && "${{ matrix.platform.skip_tests }}" != "true" ]]; then
73+
maturin develop --release
74+
fi
7575
sccache: "true"
7676
manylinux: ${{ matrix.platform.manylinux }}
7777
container: ${{ matrix.platform.is_musl && 'off' || '' }}
7878
before-script-linux: ${{ matrix.platform.before-script }}
7979

80+
# Run Rust tests after building! This ensures that the python dependencies are installed
81+
- name: Run cargo tests
82+
if: ${{ !matrix.platform.is_musl }}
83+
run: cargo test --no-default-features
84+
shell: bash
85+
8086
- name: Upload wheels
8187
uses: actions/upload-artifact@v4
8288
with:

0 commit comments

Comments
 (0)