maintenance update #854
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux / MacOS - c++ | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- test: unit_tests | |
os: ubuntu-22.04 | |
access: row_major | |
ensure: default_panic | |
- test: unit_tests | |
ensure: disabled | |
os: ubuntu-22.04 | |
access: col_major | |
- test: unit_tests | |
os: ubuntu-24.04 | |
access: col_major | |
ensure: default_panic | |
- test: unit_tests | |
os: macos-13 | |
access: col_major | |
ensure: default_panic | |
- test: unit_tests | |
os: macos-14 | |
access: col_major | |
ensure: default_panic | |
- test: install_test | |
os: ubuntu-22.04 | |
access: col_major | |
ensure: default_panic | |
- test: install_test | |
os: ubuntu-22.04 | |
access: col_major | |
ensure: custom_handler | |
- test: install_test | |
os: macos-14 | |
access: col_major | |
ensure: default_panic | |
- test: install_test | |
os: macos-14 | |
access: col_major | |
ensure: custom_handler | |
fail-fast: false | |
steps: | |
- name: Set default value for for environment variables | |
run: | | |
echo "ROW_MAJOR_DEFAULT=OFF" >> $GITHUB_ENV | |
echo "SOPHUS_DISABLE_ENSURES=OFF" >> $GITHUB_ENV | |
echo "SOPHUS_ENABLE_ENSURE_HANDLER=OFF" >> $GITHUB_ENV | |
- name: Update ROW_MAJOR_DEFAULT=ON if condition is met | |
if: matrix.access == 'row_major' | |
run: echo "ROW_MAJOR_DEFAULT=ON" >> $GITHUB_ENV | |
- name: Update SOPHUS_DISABLE_ENSURES=ON if condition is met | |
if: matrix.ensure == 'disabled' | |
run: echo "SOPHUS_DISABLE_ENSURES=ON" >> $GITHUB_ENV | |
- name: Update SOPHUS_ENABLE_ENSURE_HANDLER=ON if condition is met | |
if: matrix.ensure == 'custom_handler' | |
run: echo "SOPHUS_ENABLE_ENSURE_HANDLER=ON" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.access }}-${{ matrix.ensure }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.os }}-${{ matrix.access }}-${{ matrix.ensure }} | |
- name: Install dependencies (Linux incl. Ceres) | |
run: ./scripts/install_ubuntu_deps_incl_ceres.sh | |
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' | |
- name: Install dependencies (Mac OS incl. Ceres) | |
run: ./scripts/install_osx_deps_incl_ceres.sh | |
if: matrix.os == 'macos-14' || matrix.os == 'macos-13' | |
- name: Run tests | |
run: ./scripts/run_cpp_tests.sh | |
if: matrix.test == 'unit_tests' | |
- name: Install test | |
run: | | |
echo "Install test" | |
mkdir build_dir | |
cd build_dir | |
cmake -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -DSOPHUS_DISABLE_ENSURE=$SOPHUS_DISABLE_ENSURE -DSOPHUS_ENABLE_ENSURE_HANDLER=$SOPHUS_ENABLE_ENSURE_HANDLER | |
# Ubuntu builds via Github actions run on 2-core virtual machines | |
make -j2 | |
sudo make install | |
cd .. | |
cd examples | |
mkdir build_dir | |
cd build_dir | |
cmake .. | |
make | |
ls -la | |
if: matrix.test == 'install_test' |