-
Notifications
You must be signed in to change notification settings - Fork 53
61 lines (46 loc) · 2.02 KB
/
python-bindings-linux.yml
File metadata and controls
61 lines (46 loc) · 2.02 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
name: Build Python Bindings on Linux
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Load repository cache
run: sudo apt-get update --allow-releaseinfo-change
- name: Install system libraries
run: sudo apt-get install -y --no-install-recommends libx11-dev libxi-dev libtbb-dev libegl1-mesa-dev libglu1-mesa-dev libopencv-dev libproj-dev
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Install CMake 4.0
run: |
wget -O cmake.sh https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0-linux-x86_64.sh
sudo sh cmake.sh --skip-license --prefix=/usr/local
cmake --version
- name: Configure CMake with Python bindings
run: |
cmake -B ${{github.workspace}}/build_pybind \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DPYBIND=ON
- name: Build Python bindings
run: cmake --build ${{github.workspace}}/build_pybind --target pybind_all --config ${{env.BUILD_TYPE}}
- name: Test Python imports
working-directory: ${{github.workspace}}/build_pybind/bin/${{env.BUILD_TYPE}}
run: |
python -c "import sys; sys.path.insert(0, '.'); import core_py; print('core_py imported successfully')"
python -c "import sys; sys.path.insert(0, '.'); import lidar_odometry_py; print('lidar_odometry_py imported successfully')"
python -c "import sys; sys.path.insert(0, '.'); import multi_view_tls_registration_py; print('multi_view_tls_registration_py imported successfully')"