Skip to content

Update CMakeLists.txt #214

Update CMakeLists.txt

Update CMakeLists.txt #214

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install CMake
run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' --version=3.27.5
- name: Verify CMake version
run: cmake --version
- name: Cache vcpkg
id: cache-vcpkg
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/vcpkg
${{ github.workspace }}/vcpkg/buildtrees
${{ github.workspace }}/vcpkg/packages
${{ github.workspace }}/vcpkg/downloads
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
- name: Install vcpkg (if not cached)
if: ${{ !steps.cache-vcpkg.outputs.cache-hit }}
run: |
git clone https://github.com/microsoft/vcpkg.git %GITHUB_WORKSPACE%\vcpkg
.\vcpkg\bootstrap-vcpkg.bat
- name: Verify vcpkg installation
run: |
vcpkg version
vcpkg list
- name: Add vcpkg to PATH
shell: pwsh
run: |
echo "${{ github.workspace }}/vcpkg" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "${{ github.workspace }}/vcpkg/installed/x64-windows/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check PATH
shell: pwsh
run: echo $env:PATH
- name: Install dependencies with vcpkg
shell: cmd
run: |
cd /d "%GITHUB_WORKSPACE%"
vcpkg install --triplet x64-windows --debug
- name: List installed packages
run: vcpkg list
- name: Build project
shell: cmd
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" ^
..
cmake --build . --config Debug
- name: Run Tests
shell: cmd
run: |
cd build
ctest --output-on-failure --build-config Debug