Skip to content
# run CMake build on Windows and Linux
name: CMake Build Multi-Platform
on:
push:
branches: [ "development", "main" ]
pull_request:
branches: [ "development" ]
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
CL_PATH: "\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.37.32822\\bin\\Hostx64\\x64\""
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
include:
- os: windows-2022
c_compiler: cl
cpp_compiler: cl
preset: x64-release
- os: ubuntu-22.04
c_compiler: gcc
cpp_compiler: g++
preset: linux-release
steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Add cl To Path
run: |
dir ${{env.CL_PATH}}
echo ${{env.CL_PATH}} >> $GITHUB_PATH
cl
echo %VCToolsInstallDir%
- name: Install vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git ${{env.VCPKG_ROOT}}
${{env.VCPKG_ROOT}}/bootstrap-vcpkg.sh
- name: Configure
run: cmake --preset ${{matrix.preset}}
- name: Build
run: cmake --build --preset ${{matrix.preset}}
# - name: Test
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
# # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest --build-config ${{ matrix.build_type }}
# run: ctest --preset ${{matrix.preset}}}