Skip to content

Commit a27a5f2

Browse files
committed
Move tests to bash script
1 parent 371f6b1 commit a27a5f2

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/actions/tests/action.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,4 @@ runs:
2828

2929
- name: Run Tests
3030
shell: bash -euxo pipefail {0}
31-
run: |
32-
pytest tests/
33-
34-
LIB_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
35-
36-
if [[ "$RUNNER_OS" == "macOS" ]]; then
37-
export DYLD_LIBRARY_PATH="$LIB_DIR:${DYLD_LIBRARY_PATH:-}"
38-
else
39-
export LD_LIBRARY_PATH="$LIB_DIR:${LD_LIBRARY_PATH:-}"
40-
fi
41-
42-
source ./venv/bin/activate
43-
44-
cargo test --workspace --locked -- --nocapture
31+
run: scripts/run-tests.sh

scripts/run-tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -euxo pipefail
4+
5+
# Running Python tests
6+
uv run pytest tests/
7+
8+
# Setting up LD_LIBRARY_PATH environment variable
9+
# https://pyo3.rs/v0.28.2/building-and-distribution.html#dynamically-embedding-the-python-interpreter
10+
LIB_DIR=$(python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
11+
export LD_LIBRARY_PATH="$LIB_DIR:${LD_LIBRARY_PATH:-}"
12+
13+
uv run cargo test --workspace --locked

0 commit comments

Comments
 (0)