Skip to content

Commit

Permalink
build: Visual Studio dev environment CI job (#2047)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobBuchananCompPhys authored Feb 10, 2025
1 parent 80fa8cb commit b05240f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: MSVC

on:
pull_request:
branches:
- '*'
paths:
- 'develop.ps1'

jobs:

Checkout:
uses: "./.github/workflows/_checkout.yml"
with:
checkoutRef: ${{ github.event.pull_request.head.sha }}

MsvcDev:
runs-on: windows-latest
needs: [Checkout]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: 'Set up MSVC toolchain'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: 'Install dependencies'
shell: pwsh
working-directory: ${{ github.workspace }}
env:
qtVersion: ${{ needs.Checkout.outputs.qtVersion }}
antlrVersion: ${{ needs.Checkout.outputs.antlrVersion }}
run: |
./develop.ps1 -release -qtVersion $env:qtVersion -antlrVersion $env:antlrVersion
- name: 'Configure and build with CMake'
shell: bash
run: |
git submodule update --init --recursive
export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ inputs.qtVersion }}\msvc2019_64\bin;$PATH"
cmake --preset GUI-Release-MSVC
cmake --build build
4 changes: 3 additions & 1 deletion develop.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
ANTLR version to install. Defaults to ANTLR 4.13.1.
.PARAMETER release
Flag - install packages for release, otherwise debug.
#>

param (
Expand Down Expand Up @@ -267,7 +268,6 @@ $antlrOutput = "antlr-$antlrVersion-complete.jar"

$javaUri = "https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.zip"
$javaOutput = "java.zip"
$jdkVersion = "21.0.5"

Set-Location -Path $dependencies

Expand All @@ -281,6 +281,8 @@ Write-Host "Unpacking Java... " @info_colors
Expand-Archive -Path $javaOutput -DestinationPath . -Force
Remove-Item -Path $javaOutput -Force

$jdkVersion = $(Get-ChildItem -Path "." -Directory | Where-Object { $_.Name -match "^jdk-\d+\.\d+\.\d+$" } | Select-Object -ExpandProperty Name).split("-")[1]

$javaSDKPath = Join-Path -Path $projectDir -ChildPath "$dependencies\jdk-$jdkVersion"
$javaExePath = Join-Path -Path $javaSDKPath -ChildPath "bin\java"

Expand Down

0 comments on commit b05240f

Please sign in to comment.