Skip to content

Commit 700809f

Browse files
gh-27: Run build.ps1 from Developer PowerShell for Visual Studio.
1 parent 1403036 commit 700809f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,24 @@ jobs:
1515
- name: Setup Visual Studio
1616
uses: microsoft/setup-msbuild@v1.1
1717

18-
- name: Build interpreter and extensions
18+
- name: Build interpreter and extensions (Developer PowerShell)
1919
shell: powershell
2020
run: |
21-
.\build.ps1
21+
$vswhere = Join-Path $env:'ProgramFiles(x86)' 'Microsoft Visual Studio\Installer\vswhere.exe'
22+
if (-not (Test-Path $vswhere)) { Write-Error "vswhere not found at $vswhere"; exit 1 }
23+
$inst = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
24+
if (-not $inst) { Write-Error 'Visual Studio installation not found'; exit 1 }
25+
$vsDevCmd = Join-Path $inst 'Common7\Tools\VsDevCmd.bat'
26+
if (-not (Test-Path $vsDevCmd)) { Write-Error "VsDevCmd.bat not found: $vsDevCmd"; exit 1 }
27+
cmd /c "`"$vsDevCmd`" -noLogo && powershell -NoProfile -ExecutionPolicy Bypass -File .\build.ps1"
2228
23-
- name: Run tests
29+
- name: Run tests (Developer PowerShell)
2430
shell: powershell
2531
run: |
26-
.\prefix.exe .\tests\test2.pre
32+
$vswhere = Join-Path $env:'ProgramFiles(x86)' 'Microsoft Visual Studio\Installer\vswhere.exe'
33+
if (-not (Test-Path $vswhere)) { Write-Error "vswhere not found at $vswhere"; exit 1 }
34+
$inst = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
35+
if (-not $inst) { Write-Error 'Visual Studio installation not found'; exit 1 }
36+
$vsDevCmd = Join-Path $inst 'Common7\Tools\VsDevCmd.bat'
37+
if (-not (Test-Path $vsDevCmd)) { Write-Error "VsDevCmd.bat not found: $vsDevCmd"; exit 1 }
38+
cmd /c "`"$vsDevCmd`" -noLogo && powershell -NoProfile -ExecutionPolicy Bypass -Command .\prefix.exe .\tests\test2.pre"

0 commit comments

Comments
 (0)