Skip to content

Python wrapper update #389

Python wrapper update

Python wrapper update #389

Workflow file for this run

name: Python CI
on: [pull_request]
jobs:
build:
name: ${{ matrix.name }} ${{ matrix.build_type }} Python ${{ matrix.python_version }}
runs-on: ${{ matrix.os }}
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
PYTHON_VERSION: ${{ matrix.python_version }}
strategy:
fail-fast: false
matrix:
# Github Actions requires a single row to be added to the build matrix.
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
name: [ubuntu-22.04-gcc-9, ubuntu-22.04-clang-12, macOS-12-xcode-14.2]
build_type: [Debug, Release]
python_version: [3]
include:
- name: ubuntu-22.04-gcc-9
os: ubuntu-22.04
compiler: gcc
version: "9"
- name: ubuntu-22.04-clang-12
os: ubuntu-22.04
compiler: clang
version: "12"
- name: ubuntu-22.04-clang-12
os: ubuntu-22.04
compiler: clang
version: "12"
build_type: Debug
python_version: "3"
- name: macOS-12-xcode-14.2
os: macOS-12
compiler: xcode
version: "14.2"
steps:
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get -y update
if [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
sudo apt-get install -y clang-${{ matrix.version }} g++-multilib
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
# For SDFormat
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743
sudo apt-get -y update
sudo apt-get -y install libtbb-dev libboost-all-dev libsdformat12-dev
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
brew install gcc@${{ matrix.version }}
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi
brew install boost
brew tap osrf/simulation
brew install sdformat12
- name: Python Dependencies
run: |
# Install dependencies for gtwrap
pip3 install -U setuptools numpy pyparsing pyyaml
- name: GTSAM (Linux)
if: runner.os == 'Linux'
run: |
# Install gtsam
git clone https://github.com/borglab/gtsam.git /home/runner/work/gtsam
cd /home/runner/work/gtsam
mkdir build && cd $_
cmake -D GTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_PYTHON=ON ..
sudo make -j$(nproc) install && sudo make python-install
sudo ldconfig
cd $GITHUB_WORKSPACE # go back to home directory
- name: GTSAM (macOS)
if: runner.os == 'macOS'
run: |
# Install gtsam
git clone https://github.com/borglab/gtsam.git /Users/runner/work/gtsam
cd /Users/runner/work/gtsam
mkdir build && cd $_
cmake -D GTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/local/bin/python3 ..
make -j$(sysctl -n hw.physicalcpu) install && make python-install
cd $GITHUB_WORKSPACE # go back to home directory
- name: Checkout
uses: actions/checkout@v2
- name: Build Directory
run: mkdir build
- name: Configure (Linux)
if: runner.os == 'Linux'
run: |
cmake -DGTDYNAMICS_BUILD_PYTHON=ON ..
working-directory: ./build
- name: Configure (macOS)
if: runner.os == 'macOS'
run: |
cmake -DGTDYNAMICS_BUILD_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/local/bin/python3 ..
working-directory: ./build
- name: Build
run: make -j4
working-directory: ./build
- name: Test
run: make -j4 python-test
working-directory: ./build
- name: Install
run: sudo make -j4 python-install
working-directory: ./build