Skip to content

ci: build on windows and mac #1

ci: build on windows and mac

ci: build on windows and mac #1

name: Build and test matrix
on:
pull_request:
env:
BUILD_TYPE: Release
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_and_test_windows:
runs-on: windows-latest
steps:
- name: Get deps
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
choco install boost-msvc-14.1 --version=1.69.0
choco install libgit2 --version=0.28.1
- name: Configure environment
run: |
echo "BOOST_ROOT=C:\local\boost_1_69_0" >> $env:GITHUB_ENV
echo "CMAKE_PREFIX_PATH=C:\local\boost_1_69_0;C:\Program Files\libgit2" >> $env:GITHUB_ENV
- uses: actions/checkout@v4
- name: CMake configure
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCAPS_LOG_BUILD_TESTS=On -DBOOST_ROOT=C:\local\boost_1_69_0 -DCMAKE_PREFIX_PATH="C:\local\boost_1_69_0;C:\Program Files\libgit2"
- name: CMake build
run: cmake --build ${{github.workspace}}/build --config ${BUILD_TYPE}
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
build_and_test_macos:
runs-on: macos-latest
steps:
- name: Get deps
run: brew install libgit2 boost
- uses: actions/checkout@v4
- name: CMake configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCAPS_LOG_BUILD_TESTS=On
- name: CMake build
run: cmake --build ${{github.workspace}}/build --config ${BUILD_TYPE}
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
build_and_test_linux:
runs-on: linux-latest
steps:
- name: Get deps
run: sudo apt-get update && sudo apt-get install libboost-program-options-dev libgit2-dev
- uses: actions/checkout@v4
- name: CMake configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCAPS_LOG_BUILD_TESTS=On
- name: CMake build
run: cmake --build ${{github.workspace}}/build --config ${BUILD_TYPE}
- name: Test
working-directory: ${{ github.workspace }}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure