]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use msvc-dev-cmd to set the development environment.
authorNathan Moinvaziri <nathan@nathanm.com>
Sun, 19 Jun 2022 20:33:56 +0000 (13:33 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Mon, 15 Aug 2022 14:41:52 +0000 (16:41 +0200)
.github/workflows/nmake.yml

index 759bcce17e7136d9edea06266d0f6ecad8c164af..f8c61af0095f80867c7a61368e5f9e38c067fa10 100644 (file)
@@ -11,56 +11,58 @@ jobs:
           - name: Windows NMake x86
             os: windows-2022
             makefile: win32/Makefile.msc
-            vc-vars: x86
+            arch: x86
 
           - name: Windows NMake x64 compat
             os: windows-2022
             makefile: win32/Makefile.msc
-            vc-vars: x86_amd64
+            arch: x86_amd64
             additional-args: ZLIB_COMPAT=yes
 
           - name: Windows NMake x64 Symbol Prefix
             os: windows-2022
             makefile: win32/Makefile.msc
-            vc-vars: x86_amd64
+            arch: x86_amd64
             additional-args: SYMBOL_PREFIX=zTest_
 
           - name: Windows NMake x64 Symbol Prefix Compat
             os: windows-2022
             makefile: win32/Makefile.msc
-            vc-vars: x86_amd64
+            arch: x86_amd64
             additional-args: ZLIB_COMPAT=yes SYMBOL_PREFIX=zTest_
 
           - name: Windows NMake x64
             os: windows-2022
             makefile: win32/Makefile.msc
-            vc-vars: x86_amd64
+            arch: x86_amd64
 
           - name: Windows NMake ARM No Test
             os: windows-2022
             makefile: win32/Makefile.arm
-            vc-vars: x86_arm
+            arch: x86_arm
 
           - name: Windows NMake ARM64 No Test
             os: windows-2022
             makefile: win32/Makefile.a64
-            vc-vars: x86_arm64
+            arch: x86_arm64
 
     steps:
     - name: Checkout repository
       uses: actions/checkout@v3
 
+    - name: Setup development environment
+      uses: ilammy/msvc-dev-cmd@v1.10.0
+      with:
+        arch: ${{ matrix.arch }}
+
     - name: Compile source code
       shell: cmd
-      run: |
-        call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vc-vars }}
-        nmake -f ${{ matrix.makefile }} ${{ matrix.additional-args }}
+      run: nmake -f ${{ matrix.makefile }} ${{ matrix.additional-args }}
 
     - name: Run test cases
       shell: cmd
       # Don't run tests on Windows ARM
-      if: contains(matrix.vc-vars, 'arm') == false
+      if: contains(matrix.arch, 'arm') == false
       run: |
-        call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.vc-vars }}
         nmake -f ${{ matrix.makefile }} ${{ matrix.additional-args }} test
         nmake -f ${{ matrix.makefile }} ${{ matrix.additional-args }} testdll