chore: update CI workflows and vcpkg configuration
- Removed unused gRPC and protobuf dependencies from `vcpkg.json`. - Updated CI configuration to enable vcpkg installation for SDL2 and yaml-cpp. - Added support for MSVC in CI workflows and improved caching strategies for vcpkg packages. - Enhanced logging in build steps to provide better feedback on dependency status and build progress.
This commit is contained in:
67
.github/workflows/ci.yml
vendored
67
.github/workflows/ci.yml
vendored
@@ -58,10 +58,14 @@ jobs:
|
|||||||
os: macos-14
|
os: macos-14
|
||||||
cc: clang
|
cc: clang
|
||||||
cxx: clang++
|
cxx: clang++
|
||||||
- name: "Windows 2022 (Clang)"
|
- name: "Windows 2022 (Clang-CL)"
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
cc: clang-cl
|
cc: clang-cl
|
||||||
cxx: clang-cl
|
cxx: clang-cl
|
||||||
|
- name: "Windows 2022 (MSVC)"
|
||||||
|
os: windows-2022
|
||||||
|
cc: cl
|
||||||
|
cxx: cl
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -80,7 +84,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
||||||
vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509' # 2025.01.20 release
|
vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509' # 2025.01.20 release
|
||||||
runVcpkgInstall: false # Let CMake handle installation via manifest mode
|
runVcpkgInstall: true # Pre-install SDL2, yaml-cpp (fast packages only)
|
||||||
|
|
||||||
- name: Retry vcpkg setup (Windows)
|
- name: Retry vcpkg setup (Windows)
|
||||||
if: runner.os == 'Windows' && steps.vcpkg.outcome == 'failure'
|
if: runner.os == 'Windows' && steps.vcpkg.outcome == 'failure'
|
||||||
@@ -92,7 +96,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
||||||
vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509'
|
vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509'
|
||||||
runVcpkgInstall: false
|
runVcpkgInstall: true
|
||||||
|
|
||||||
- name: Resolve vcpkg toolchain (Windows)
|
- name: Resolve vcpkg toolchain (Windows)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
@@ -185,23 +189,64 @@ jobs:
|
|||||||
Write-Host "✅ vcpkg-configuration.json found"
|
Write-Host "✅ vcpkg-configuration.json found"
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Restore ccache
|
- name: Setup sccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-${{ matrix.cc }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-${{ matrix.cc }}-
|
||||||
|
max-size: 500M
|
||||||
|
variant: sccache
|
||||||
|
|
||||||
|
- name: Configure sccache for clang-cl
|
||||||
|
if: runner.os == 'Windows' && matrix.cc == 'clang-cl'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
echo "CC=sccache clang-cl" >> $env:GITHUB_ENV
|
||||||
|
echo "CXX=sccache clang-cl" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Restore vcpkg packages cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.ccache
|
path: |
|
||||||
key: ccache-${{ runner.os }}-${{ matrix.cc }}-${{ hashFiles('CMakeLists.txt', 'src/**', 'test/**', 'cmake/**') }}
|
build/vcpkg_installed
|
||||||
|
${{ github.workspace }}/vcpkg/packages
|
||||||
|
${{ github.workspace }}/vcpkg/buildtrees
|
||||||
|
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
ccache-${{ runner.os }}-${{ matrix.cc }}-
|
vcpkg-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Restore CMake dependencies
|
- name: Restore FetchContent dependencies (gRPC)
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
build/_deps
|
build/_deps
|
||||||
build/vcpkg_installed
|
key: fetchcontent-${{ runner.os }}-${{ matrix.cc }}-${{ hashFiles('cmake/grpc*.cmake') }}-v2
|
||||||
key: cmake-deps-${{ runner.os }}-${{ matrix.cc }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**/CMakeLists.txt', 'src/**/*.cmake', 'test/CMakeLists.txt') }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cmake-deps-${{ runner.os }}-${{ matrix.cc }}-
|
fetchcontent-${{ runner.os }}-${{ matrix.cc }}-
|
||||||
|
|
||||||
|
- name: Monitor build progress (Windows)
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Host "=== Pre-Build Status ===" -ForegroundColor Cyan
|
||||||
|
|
||||||
|
# Check if gRPC is cached
|
||||||
|
if (Test-Path "build/_deps/grpc-subbuild") {
|
||||||
|
Write-Host "✅ gRPC FetchContent cache found" -ForegroundColor Green
|
||||||
|
} else {
|
||||||
|
Write-Host "⚠️ gRPC will be built from source (~10-15 min first time)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check vcpkg packages
|
||||||
|
if (Test-Path "build/vcpkg_installed") {
|
||||||
|
Write-Host "✅ vcpkg packages cache found" -ForegroundColor Green
|
||||||
|
if (Test-Path "${{ github.workspace }}/vcpkg/vcpkg.exe") {
|
||||||
|
& "${{ github.workspace }}/vcpkg/vcpkg.exe" list
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Write-Host "⚠️ vcpkg packages will be installed (~2-3 min)" -ForegroundColor Yellow
|
||||||
|
}
|
||||||
|
|
||||||
- name: Install Dependencies (Unix)
|
- name: Install Dependencies (Unix)
|
||||||
id: deps
|
id: deps
|
||||||
|
|||||||
80
.github/workflows/release.yml
vendored
80
.github/workflows/release.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
||||||
vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509'
|
vcpkgGitCommitId: 'b2c74683ecfd6a8e7d27ffb0df077f66a9339509'
|
||||||
runVcpkgInstall: false
|
runVcpkgInstall: true
|
||||||
env:
|
env:
|
||||||
VCPKG_DEFAULT_TRIPLET: x64-windows-static
|
VCPKG_DEFAULT_TRIPLET: x64-windows-static
|
||||||
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
|
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
|
||||||
@@ -42,18 +42,67 @@ jobs:
|
|||||||
choco install --no-progress -y nasm
|
choco install --no-progress -y nasm
|
||||||
"C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Append
|
"C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Append
|
||||||
|
|
||||||
- name: Setup MSVC
|
- name: Setup MSVC environment for clang-cl
|
||||||
uses: ilammy/msvc-dev-cmd@v1
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
with:
|
with:
|
||||||
arch: x64
|
arch: x64
|
||||||
|
|
||||||
|
- name: Configure clang-cl
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
Write-Host "Setting up clang-cl compiler"
|
||||||
|
echo "CC=clang-cl" >> $env:GITHUB_ENV
|
||||||
|
echo "CXX=clang-cl" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Setup sccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: windows-x64-release-${{ github.run_id }}
|
||||||
|
restore-keys: |
|
||||||
|
windows-x64-release-
|
||||||
|
max-size: 500M
|
||||||
|
variant: sccache
|
||||||
|
|
||||||
|
- name: Restore vcpkg packages cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
build/vcpkg_installed
|
||||||
|
${{ github.workspace }}/vcpkg/packages
|
||||||
|
key: vcpkg-release-${{ hashFiles('vcpkg.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
vcpkg-release-
|
||||||
|
|
||||||
|
- name: Restore FetchContent dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
build/_deps
|
||||||
|
key: fetchcontent-release-${{ hashFiles('cmake/grpc*.cmake') }}-v2
|
||||||
|
restore-keys: |
|
||||||
|
fetchcontent-release-
|
||||||
|
|
||||||
|
- name: Configure sccache
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
echo "CC=sccache clang-cl" >> $env:GITHUB_ENV
|
||||||
|
echo "CXX=sccache clang-cl" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
id: configure
|
id: configure
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
|
Write-Host "=== Build Configuration ===" -ForegroundColor Cyan
|
||||||
|
Write-Host "Compiler: clang-cl"
|
||||||
|
Write-Host "Build Type: Release"
|
||||||
|
cmake --version
|
||||||
|
clang-cl --version
|
||||||
|
|
||||||
$toolchain = "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
$toolchain = "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||||
cmake -S . -B build `
|
cmake -S . -B build `
|
||||||
-DCMAKE_BUILD_TYPE=Release `
|
-DCMAKE_BUILD_TYPE=Release `
|
||||||
|
-DCMAKE_C_COMPILER=clang-cl `
|
||||||
|
-DCMAKE_CXX_COMPILER=clang-cl `
|
||||||
-DCMAKE_TOOLCHAIN_FILE=$toolchain `
|
-DCMAKE_TOOLCHAIN_FILE=$toolchain `
|
||||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
|
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
|
||||||
-DVCPKG_MANIFEST_MODE=ON `
|
-DVCPKG_MANIFEST_MODE=ON `
|
||||||
@@ -88,6 +137,33 @@ jobs:
|
|||||||
Write-Host "::group::Build Log (last 100 lines)"
|
Write-Host "::group::Build Log (last 100 lines)"
|
||||||
Get-Content build.log -Tail 100
|
Get-Content build.log -Tail 100
|
||||||
Write-Host "::endgroup::"
|
Write-Host "::endgroup::"
|
||||||
|
|
||||||
|
# Check for specific error patterns
|
||||||
|
if (Select-String -Path "build.log" -Pattern "vcpkg" -Quiet) {
|
||||||
|
Write-Host "`n::group::vcpkg-related errors" -ForegroundColor Yellow
|
||||||
|
Select-String -Path "build.log" -Pattern "vcpkg.*error" -CaseSensitive:$false | Select-Object -First 10
|
||||||
|
Write-Host "::endgroup::"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Select-String -Path "build.log" -Pattern "LNK[0-9]{4}" -Quiet) {
|
||||||
|
Write-Host "`n::group::Linker errors" -ForegroundColor Yellow
|
||||||
|
Select-String -Path "build.log" -Pattern "LNK[0-9]{4}" | Select-Object -First 10
|
||||||
|
Write-Host "::endgroup::"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Select-String -Path "build.log" -Pattern "fatal error" -Quiet) {
|
||||||
|
Write-Host "`n::group::Fatal errors" -ForegroundColor Yellow
|
||||||
|
Select-String -Path "build.log" -Pattern "fatal error" | Select-Object -First 10
|
||||||
|
Write-Host "::endgroup::"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# List vcpkg installed packages
|
||||||
|
$vcpkgExe = "${{ github.workspace }}/vcpkg/vcpkg.exe"
|
||||||
|
if (Test-Path $vcpkgExe) {
|
||||||
|
Write-Host "`n::group::Installed vcpkg packages"
|
||||||
|
& $vcpkgExe list
|
||||||
|
Write-Host "::endgroup::"
|
||||||
}
|
}
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ option(YAZE_USE_VCPKG_GRPC "Use vcpkg pre-compiled gRPC packages (Windows only)"
|
|||||||
|
|
||||||
if(WIN32 AND YAZE_USE_VCPKG_GRPC)
|
if(WIN32 AND YAZE_USE_VCPKG_GRPC)
|
||||||
message(STATUS "Attempting to use vcpkg gRPC packages for faster Windows builds...")
|
message(STATUS "Attempting to use vcpkg gRPC packages for faster Windows builds...")
|
||||||
message(STATUS " Note: This is only for full builds with YAZE_WITH_GRPC=ON")
|
message(STATUS " Note: If gRPC not in vcpkg.json, will fallback to FetchContent (recommended)")
|
||||||
|
|
||||||
# Debug: Check if vcpkg toolchain is being used
|
# Debug: Check if vcpkg toolchain is being used
|
||||||
if(DEFINED VCPKG_TOOLCHAIN)
|
if(DEFINED VCPKG_TOOLCHAIN)
|
||||||
@@ -238,21 +238,15 @@ if(WIN32 AND YAZE_USE_VCPKG_GRPC)
|
|||||||
message(STATUS "gRPC setup complete via vcpkg (includes bundled Abseil)")
|
message(STATUS "gRPC setup complete via vcpkg (includes bundled Abseil)")
|
||||||
return()
|
return()
|
||||||
else()
|
else()
|
||||||
message(WARNING "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
message(STATUS "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
||||||
message(WARNING " vcpkg gRPC not found")
|
message(STATUS " vcpkg gRPC not found (expected if removed from vcpkg.json)")
|
||||||
message(WARNING " For faster builds (5 min vs 45 min), install:")
|
message(STATUS " Using FetchContent build (faster with caching)")
|
||||||
message(WARNING " ")
|
message(STATUS " First build: ~10-15 min, subsequent: <1 min (cached)")
|
||||||
message(WARNING " vcpkg install grpc:x64-windows")
|
message(STATUS " Using gRPC v1.67.1 for Windows compatibility")
|
||||||
message(WARNING " ")
|
message(STATUS "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
||||||
message(WARNING " Then configure with:")
|
|
||||||
message(WARNING " cmake -DCMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake ..")
|
|
||||||
message(WARNING " ")
|
|
||||||
message(WARNING " Falling back to FetchContent (slow but works)")
|
|
||||||
message(WARNING " Using gRPC v1.67.1 (MSVC-compatible)")
|
|
||||||
message(WARNING "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If we reach here, vcpkg wasn't used - fall back to standard grpc.cmake
|
# If we reach here, vcpkg wasn't used - fall back to standard grpc.cmake
|
||||||
message(STATUS "Using FetchContent for gRPC (standard path)")
|
message(STATUS "Using FetchContent for gRPC (recommended path for Windows)")
|
||||||
set(YAZE_GRPC_CONFIGURED FALSE PARENT_SCOPE)
|
set(YAZE_GRPC_CONFIGURED FALSE PARENT_SCOPE)
|
||||||
|
|||||||
Submodule src/lib/imgui updated: e1b27ce51e...28dabdcb9e
12
vcpkg.json
12
vcpkg.json
@@ -5,14 +5,6 @@
|
|||||||
"description": "Yet Another Zelda3 Editor",
|
"description": "Yet Another Zelda3 Editor",
|
||||||
"builtin-baseline": "b2c74683ecfd6a8e7d27ffb0df077f66a9339509",
|
"builtin-baseline": "b2c74683ecfd6a8e7d27ffb0df077f66a9339509",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
{
|
|
||||||
"name": "grpc",
|
|
||||||
"platform": "windows"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "protobuf",
|
|
||||||
"platform": "windows"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "sdl2",
|
"name": "sdl2",
|
||||||
"platform": "windows"
|
"platform": "windows"
|
||||||
@@ -20,10 +12,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yaml-cpp",
|
"name": "yaml-cpp",
|
||||||
"platform": "windows"
|
"platform": "windows"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "zlib",
|
|
||||||
"platform": "windows"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user