Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
231 changes: 0 additions & 231 deletions .github/workflows/common-ci.yml

This file was deleted.

131 changes: 131 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Linux CI

on: [pull_request]

# Cancels any in-progress workflow runs for the same PR when a new push is made,
# allowing the runner to become available more quickly for the latest changes.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.name }} ${{ matrix.build_type }} C++/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 }}
GTSAM_INSTALL_DIR: ${{ github.workspace }}/gtsam_install

strategy:
fail-fast: false
matrix:
name: [ubuntu-24.04-gcc-14, ubuntu-24.04-clang-16]
build_type: [Debug, Release]
python_version: [3]
include:
- name: ubuntu-24.04-gcc-14
os: ubuntu-24.04
compiler: gcc
version: "14"
- name: ubuntu-24.04-clang-16
os: ubuntu-24.04
compiler: clang
version: "16"

steps:
- name: Checkout GTDynamics Repository
uses: actions/checkout@v4

- name: Install System Dependencies
run: |
set -e
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
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 libsdformat15-dev

# GTDynamics C++ tests use CppUnitLite (not provided by default on the runner).
git clone https://github.com/borglab/CppUnitLite.git /tmp/CppUnitLite
cd /tmp/CppUnitLite
mkdir build && cd build
# CppUnitLite's CMakeLists uses an old minimum CMake version; newer CMake
# requires explicitly opting into older policy compatibility.
# Force a modern C++ standard for newer Boost headers (Homebrew Boost requires C++11+).
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON ..
sudo make -j$(nproc) install
cd ${{ github.workspace }}
sudo rm -rf /tmp/CppUnitLite

- name: Python Dependencies
run: |
pip3 install -U "setuptools<70" wheel numpy pyparsing pyyaml "pybind11-stubgen>=2.5.1"

- name: Build & Install GTSAM
shell: bash
run: |
set -e
git clone https://github.com/borglab/gtsam.git /tmp/gtsam_source_linux
cd /tmp/gtsam_source_linux
mkdir build && cd $_
cmake -D GTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-D GTSAM_BUILD_PYTHON=ON \
-D GTSAM_WITH_TBB=OFF \
-D CMAKE_CXX_FLAGS="-faligned-new" \
-D CMAKE_INSTALL_PREFIX=${{ env.GTSAM_INSTALL_DIR }} \
..
sudo make -j$(nproc) install
make python-install
sudo ldconfig
cd ${{ github.workspace }}
sudo rm -rf /tmp/gtsam_source_linux

- name: Create build directory
run: mkdir build

- name: Configure GTDynamics
run: |
set -e
cmake -DGTDYNAMICS_BUILD_PYTHON=ON \
-DGTSAM_DIR="${{ env.GTSAM_INSTALL_DIR }}/lib/cmake/GTSAM" \
-DCMAKE_PREFIX_PATH="${{ env.GTSAM_INSTALL_DIR }}" \
..
working-directory: ./build

- name: Build
run: make -j$(nproc)
working-directory: ./build

- name: Test C++
run: |
set -e
make -j$(nproc) check
working-directory: ./build

- name: Install Python Wrappers
shell: bash
run: |
set -e
sudo make -j$(nproc) python-install
working-directory: ./build

- name: Test Python
run: |
set -e
# On Linux, `sudo ldconfig` during GTSAM install should handle library paths for system-wide installs.
# If GTSAM was installed to a custom prefix not in ldconfig paths, LD_LIBRARY_PATH would be needed.
make -j$(nproc) python-test
working-directory: ./build
Loading
Loading