Skip to content

Added msvc build test. #97

Added msvc build test.

Added msvc build test. #97

name: Build & Test
on:
push:
branches:
- 'feat/*'
- 'fix/*'
pull_request:
branches: ["master"]
env:
BUILD_TYPE: Release
jobs:
compiler_matrix:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
cxx_standard: [14, 17, 20]
compiler:
- pkg: g++-14
cxx: g++-14
- pkg: g++-13
cxx: g++-13
- pkg: g++-12
cxx: g++-12
- pkg: g++-11
cxx: g++-11
- pkg: clang-18
cxx: clang++-18
- pkg: clang-17
cxx: clang++-17
- pkg: clang-16
cxx: clang++-16
steps:
- name: Add universe repository
run: sudo add-apt-repository universe
- name: Update apt
run: sudo apt-get update
- name: Do install
run: sudo apt-get install -y ${{ matrix.compiler.pkg }} cmake ninja-build libgtest-dev libgmock-dev
- name: Checkout
uses: actions/checkout@v2
- name: CMake Configure
run: cmake -B ${{github.workspace}}/build -G"Ninja" -DINT_TREE_USE_OPTIONAL_POLYFILL=on -DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}
- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Test
working-directory: ${{github.workspace}}/build
run: ./tests/tree-tests
msvc:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup MSVC
uses: microsoft/[email protected]
- name: Install vcpkg and gtest
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg.exe install gtest
shell: pwsh
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
- name: CMake Configure
run: cmake -B ${{github.workspace}}/build -G"Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_CXX_STANDARD=20 -DINT_TREE_USE_OPTIONAL_POLYFILL=on -DINT_TREE_BUILD_EXAMPLES=on -DINT_TREE_ENABLE_TESTS=on -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: .\tests\Release\tree-tests.exe
shell: cmd