forked from nav-io/libblsct-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.78 KB
/
python-unit-tests.yml
File metadata and controls
72 lines (61 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
71
name: 'Python: Run unit tests'
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'ffi/python/**'
- '!.pytest_cache/**'
- '!dist/**'
- '!docs/**'
- '!navio-core/**'
- '!navio_blsct.egg-info/**'
- '!venv/**'
jobs:
python-run-unit-tests:
strategy:
matrix:
os: ["ubuntu-24.04", "macos-15"]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Install system dependencies
run: |
if [[ $RUNNER_OS == 'Linux' ]]; then
sudo apt-get update && sudo apt-get install -y swig autoconf automake libtool pkg-config
elif [[ $RUNNER_OS == 'macOS' ]]; then
brew install swig autoconf automake libtool pkg-config
fi
- name: macOS SDK setup
if: runner.os == 'macOS'
run: |
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
xcode-select -p
xcrun --show-sdk-path
clang --version
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
pip install setuptools build pytest
- uses: actions/checkout@v3
with:
clean: true
- name: Build and install the package
run: |
cd ffi/python
if [[ "$RUNNER_OS" == "macOS" ]]; then
export SDKROOT="$(xcrun --show-sdk-path)"
export CPPFLAGS="-isysroot $SDKROOT"
export CFLAGS="-isysroot $SDKROOT"
export CXXFLAGS="-isysroot $SDKROOT"
fi
python -m build
pip install dist/*.whl
- name: Run tests
run: |
cd ffi/python
pytest tests