Skip to content

vcpkg ci

vcpkg ci #128

Workflow file for this run

name: Special Cases CI
on:
pull_request:
paths-ignore:
- '**.md'
- '**.ipynb'
- 'myst.yml'
# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.name }} ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
env:
CTEST_OUTPUT_ON_FAILURE: ON
CTEST_PARALLEL_LEVEL: 2
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
GTSAM_BUILD_UNSTABLE: ON
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-clang-deprecated,
# ubuntu-clang-quaternions,
# ubuntu-clang-tbb,
# ubuntu-clang-cayleymap,
ubuntu-clang-system-libs,
# ubuntu-no-boost,
# ubuntu-no-unstable,
# ubuntu-build-examples,
]
build_type: [Debug, Release]
include:
# - name: ubuntu-clang-deprecated
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: deprecated
# - name: ubuntu-clang-quaternions
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: quaternions
# - name: ubuntu-clang-tbb
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: tbb
# - name: ubuntu-clang-cayleymap
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: cayley
- name: ubuntu-clang-system-libs
os: ubuntu-22.04
compiler: clang
version: "14"
flag: system
# - name: ubuntu-no-boost
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: no_boost
# - name: ubuntu-no-unstable
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: no_unstable
# - name: ubuntu-build-examples
# os: ubuntu-22.04
# compiler: clang
# version: "14"
# flag: build_examples
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get -y update
sudo apt-get -y install software-properties-common
# LLVM (clang) 9/14 is not in 22.04 (jammy)'s repositories so we add the official LLVM repository.
if [ "${{ matrix.compiler }}" = "clang" ]; then
# (ipv4|ha).pool.sks-keyservers.net is the SKS GPG global keyserver pool
# ipv4 avoids potential timeouts because of crappy IPv6 infrastructure
# 15CF4D18AF4F7421 is the GPG key for the LLVM apt repository
# This key is not in the keystore by default for Ubuntu so we need to add it.
LLVM_KEY=15CF4D18AF4F7421
gpg --keyserver keyserver.ubuntu.com --recv-key $LLVM_KEY || gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key $LLVM_KEY
gpg -a --export $LLVM_KEY | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
fi
sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev ninja-build
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-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
fi
- name: Install (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake ninja
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Install Boost
run: |
if [ ${{matrix.flag}} != 'no_boost' ]; then
if [ ${{runner.os}} == 'Linux' ]; then
sudo apt-get -y install libboost-all-dev
elif [ ${{runner.os}} == 'macOS' ]; then
brew install boost
fi
fi
- name: Set Allow Deprecated Flag
if: matrix.flag == 'deprecated'
run: |
echo "GTSAM_ALLOW_DEPRECATED_SINCE_V43=ON" >> $GITHUB_ENV
echo "Allow deprecated since version 4.3"
- name: Set Use Quaternions Flag
if: matrix.flag == 'quaternions'
run: |
echo "GTSAM_USE_QUATERNIONS=ON" >> $GITHUB_ENV
echo "Use Quaternions for rotations"
- name: Set GTSAM_WITH_TBB Flag
if: matrix.flag == 'tbb'
run: |
echo "GTSAM_WITH_TBB=ON" >> $GITHUB_ENV
echo "GTSAM Uses TBB"
- name: Use Cayley Transform for Rot3
if: matrix.flag == 'cayley'
run: |
echo "GTSAM_POSE3_EXPMAP=OFF" >> $GITHUB_ENV
echo "GTSAM_ROT3_EXPMAP=OFF" >> $GITHUB_ENV
echo "GTSAM Uses Cayley map for Rot3"
- name: Build Examples
if: matrix.flag == 'build_examples'
run: |
echo "GTSAM_BUILD_EXAMPLES_ALWAYS=ON" >> $GITHUB_ENV
- name: Use system versions of 3rd party libraries
if: matrix.flag == 'system'
run: |
sudo apt-get install libeigen3-dev
echo "GTSAM_USE_SYSTEM_EIGEN=ON" >> $GITHUB_ENV
# TODO(dellaert): This does not work yet?
sudo apt-get install libmetis-dev
echo "GTSAM_USE_SYSTEM_METIS=ON" >> $GITHUB_ENV
- name: Turn off boost
if: matrix.flag == 'no_boost'
run: |
echo "GTSAM_ENABLE_BOOST_SERIALIZATION=OFF" >> $GITHUB_ENV
echo "GTSAM_USE_BOOST_FEATURES=OFF" >> $GITHUB_ENV
echo "GTSAM will not use BOOST"
- name: Turn off unstable
if: matrix.flag == 'no_unstable'
run: |
echo "GTSAM_BUILD_UNSTABLE=OFF" >> $GITHUB_ENV
echo "GTSAM 'unstable' will not be built."
- name: Create swap (Linux only)
if: runner.os == 'Linux'
shell: bash
run: |
# Attempts to create and enable a swap file at /mnt/swapfile.
# It tries different sizes (8G, 4G, 2G, 1G) until successful.
set -euo pipefail
SWAP=/mnt/swapfile
sudo swapoff $SWAP 2>/dev/null || true
sudo rm -f $SWAP
for SIZE in 8 4 2 1; do
if sudo fallocate -l ${SIZE}G $SWAP; then
sudo chmod 600 $SWAP
sudo mkswap $SWAP
sudo swapon $SWAP && break
fi
sudo rm -f $SWAP
done
# Displays active swap spaces at the end.
swapon --show
- name: Build & Test
run: |
bash .github/scripts/unix.sh -t