git: Added MSVC build CI (#2115)

This commit is contained in:
Nik 2025-02-15 15:44:16 +01:00 committed by GitHub
parent b70120a248
commit b46deb3fa0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 81 additions and 6 deletions

View File

@ -15,8 +15,8 @@ env:
jobs:
# Windows build
win:
# Windows MINGW build
win_mingw:
runs-on: windows-2022
name: 🪟 Windows MINGW64
@ -41,8 +41,8 @@ jobs:
uses: hendrikmuhs/ccache-action@v1
id: cache-ccache
with:
key: ${{ runner.os }}-ccache-${{ github.run_id }}
restore-keys: ${{ runner.os }}-ccache
key: ${{ runner.os }}-mingw-ccache-${{ github.run_id }}
restore-keys: ${{ runner.os }}-mingw-ccache
max-size: 1G
- name: 🟦 Install msys2
@ -178,6 +178,80 @@ jobs:
path: |
build/install/*
win_msvc:
runs-on: windows-2022
name: 🪟 Windows MSVC
env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"
permissions:
id-token: write
attestations: write
steps:
- name: 🧰 Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 🫧 Setup Visual Studio Dev Environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: 📜 Setup ccache
uses: hendrikmuhs/ccache-action@v1
id: cache-ccache
with:
key: ${{ runner.os }}-msvc-ccache-${{ github.run_id }}
restore-keys: ${{ runner.os }}-msvc-ccache
max-size: 1G
- name: 📦 Install vcpkg
uses: friendlyanon/setup-vcpkg@v1
with: { committish: 7e21420f775f72ae938bdeb5e6068f722088f06a }
- name: ⬇️ Install dependencies
run: |
cp dist/vcpkg.json vcpkg.json
- name: ⬇️ Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: ⬇️ Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.100'
- name: 📜 Set version variable
run: |
"IMHEX_VERSION=$(Get-Content VERSION -Raw)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Windows cmake build
- name: 🛠️ Configure CMake
run: |
mkdir -p build
cmake -G "Ninja" -B build `
--preset vs2022 `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DCMAKE_C_COMPILER="$($(Get-Command cl.exe).Path)" `
-DCMAKE_CXX_COMPILER="$($(Get-Command cl.exe).Path)" `
-DCMAKE_C_COMPILER_LAUNCHER=ccache `
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache `
-DCMAKE_BUILD_TYPE="$env:BUILD_TYPE" `
-DIMHEX_PATTERNS_PULL_MASTER=ON `
-DIMHEX_COMMIT_HASH_LONG="$env:GITHUB_SHA" `
-DIMHEX_COMMIT_BRANCH="$($env:GITHUB_REF -replace '.*/', '')" `
-DDOTNET_EXECUTABLE="C:/Program Files/dotnet/dotnet.exe" `
.
- name: 🛠️ Build
run: |
cd build
ninja
win-plugin-template-test:
runs-on: windows-2022
name: 🧪 Plugin Template Test
@ -186,7 +260,7 @@ jobs:
run:
shell: msys2 {0}
needs: win
needs: win_mingw
env:
IMHEX_SDK_PATH: "${{ github.workspace }}/out/sdk"

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ CMakeUserPresets.json
Brewfile.lock.json
.vs/
vcpkg.json

View File

@ -1425,7 +1425,7 @@ namespace hex::plugin::builtin {
const auto &currScope = evaluator->getScope(-m_debuggerScopeIndex);
if (ImGui::BeginCombo("##scope", displayValue(currScope.parent, m_debuggerScopeIndex).c_str())) {
for (size_t i = 0; i < evaluator->getScopeCount(); i++) {
auto &scope = evaluator->getScope(-i);
auto &scope = evaluator->getScope(-i32(i));
if (ImGui::Selectable(displayValue(scope.parent, i).c_str(), i == size_t(m_debuggerScopeIndex))) {
m_debuggerScopeIndex = i;