Fix build on old compilers and add CI #12
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: Astroimsum CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
build_type: [Release, Debug] | |
cpp_compiler: [g++, clang++] | |
include: | |
- os: ubuntu-latest | |
cpp_compiler: g++ | |
- os: ubuntu-latest | |
cpp_compiler: clang++ | |
- os: macos-latest | |
cpp_compiler: clang++ | |
exclude: | |
- os: macos-latest | |
cpp_compiler: g++ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install Boost on Linux | |
shell: bash | |
run: sudo apt-get install libboost-all-dev | |
if: runner.os == 'Linux' | |
- name: Install Boost on MacOS | |
shell: bash | |
run: | | |
brew upgrade | |
brew install boost | |
if: runner.os == 'macOS' | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Test | |
working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
run: ctest --build-config ${{ matrix.build_type }} |