Update: for the new changes #1
Workflow file for this run
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: Windows x86_64 | |
on: [push, pull_request] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install vcpkg | |
run: | | |
git clone https://github.com/microsoft/vcpkg.git | |
.\vcpkg\bootstrap-vcpkg.bat | |
echo "VCPKG_ROOT=$(pwd)/vcpkg" >> $GITHUB_ENV | |
echo "CMAKE_TOOLCHAIN_FILE=$(pwd)/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV | |
- name: Install CMake | |
run: | | |
vcpkg search cmake | |
vcpkg install cmake:x64-windows | |
vcpkg integrate install | |
- name: Install GTest | |
run: | | |
vcpkg search gtest | |
vcpkg install gtest:x64-windows | |
vcpkg integrate install | |
- name: Install TBB | |
run: | | |
vcpkg search tbb | |
vcpkg install tbb:x64-windows | |
vcpkg integrate install | |
- name: Update vcpkg | |
run: | | |
vcpkg update | |
vcpkg upgrade --no-dry-run | |
- name: Setup CMake and Ninja | |
uses: lukka/[email protected] | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Check MSVC Version | |
run: | | |
try { | |
$versionOutput = cl 2>&1 | |
$match = $versionOutput | Select-String -Pattern "Version (\d+\.\d+)" | |
if ($match) { | |
$version = [Version]$match.Matches.Groups[1].Value | |
Write-Output "MSVC version found: $version" | |
if ($version -lt [Version]"19.28") { | |
throw "MSVC version is less than 19.28" | |
} | |
} else { | |
Write-Output "MSVC version could not be determined. Skipping version check." | |
echo "::set-output name=skip_step::true" | |
} | |
} catch { | |
throw $_ | |
} | |
shell: pwsh | |
id: check_msvc | |
- name: Create build directory | |
if: steps.check_msvc.outputs.skip_step != 'true' | |
run: mkdir build | |
- name: Verify vcpkg Installation | |
run: .\vcpkg\vcpkg.exe list | |
- name: Configure CMake | |
run: | | |
echo "CMAKE_TOOLCHAIN_FILE is: $env:CMAKE_TOOLCHAIN_FILE" | |
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake | |
- name: Build | |
run: cmake --build build --config ${{ env.BUILD_TYPE }} --verbose | |
- name: List build and lib directory contents | |
run: | | |
ls -R build/ | |
ls -R build/lib/ | |
- name: Diagnostics if build fails | |
if: failure() | |
run: | | |
echo "Build failed. Listing build directory contents:" | |
ls -R build/ | |
Get-ChildItem -Path .\lib\Release\ -Recurse -Name | |
shell: pwsh |