Skip to content

Commit c3ba9e5

Browse files
author
Ivan Zhakov
committed
* .github/workflows/windows.yml: Save VS DevEnv environment to GITHUB_ENV to
avoid calling VsDevCmd.bat script on all steps. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1926628 13f79535-47bb-0310-9956-ffa450edef68
1 parent a46a586 commit c3ba9e5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/windows.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ jobs:
127127
runs-on: ${{ matrix.os }}
128128

129129
steps:
130+
- name: Prepare Environment
131+
shell: pwsh
132+
run: |
133+
$root = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
134+
Import-Module "$root\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
135+
Enter-VsDevShell -VsInstallPath $root -DevCmdArguments "-arch=${{ matrix.arch }}"
136+
137+
ls env: | foreach { "$($_.Name)=$($_.Value)" >> $env:GITHUB_ENV }
138+
130139
- name: Install dependencies
131140
if: ${{ matrix.packages != '' }}
132141
run: vcpkg install --triplet ${{ matrix.triplet }} ${{ matrix.packages }}
@@ -138,7 +147,6 @@ jobs:
138147
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
139148
shell: cmd
140149
run: |
141-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ matrix.arch }}
142150
cmake -B ${{github.workspace}}/build ^
143151
-G "${{ matrix.generator }}" ^
144152
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ^
@@ -153,7 +161,6 @@ jobs:
153161
# Build your program with the given configuration
154162
shell: cmd
155163
run: |
156-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ matrix.arch }}
157164
cmake --build ${{github.workspace}}/build --config ${{ matrix.build-type }}
158165
159166
- name: Test

0 commit comments

Comments
 (0)