From 10b19700fe80ad670d66f01eaa6f71d0047eadbe Mon Sep 17 00:00:00 2001 From: oktonion <0oktonion0@gmail.com> Date: Sun, 8 Sep 2024 03:08:24 +0300 Subject: [PATCH] Update c-cpp.yml --- .github/workflows/c-cpp.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 84ebb68..06dbc5c 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -130,16 +130,18 @@ jobs: BUILD_SCRIPT: ~build_tests.bat RUN_SCRIPT: run_tests.bat SETUP_SCRIPT: | - vswhere -latest set MSVS_VSVARS_PATH="C:\PROGRA~2\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" + if exist %MSVS_VSVARS_PATH% ( + ) else ( + vswhere -latest + set MSVS_VSVARS_PATH="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" + ) echo %MSVS_VSVARS_PATH% if exist %MSVS_VSVARS_PATH% ( echo call %MSVS_VSVARS_PATH% > ~build_tests.bat cat build_tests.bat >> ~build_tests.bat ) else ( echo "cannot find %MSVS_VSVARS_PATH%" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" & dir - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\" & dir exit /B 1 ) @@ -153,7 +155,11 @@ jobs: RUN_SCRIPT: run_tests.bat SETUP_SCRIPT: | set MSVS_VSVARS_PATH="C:\PROGRA~2\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" - vswhere -latest + if exist %MSVS_VSVARS_PATH% ( + ) else ( + vswhere -latest + set MSVS_VSVARS_PATH="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat" + ) echo %MSVS_VSVARS_PATH% if exist %MSVS_VSVARS_PATH% ( echo call %MSVS_VSVARS_PATH% > ~build_tests.bat @@ -161,8 +167,6 @@ jobs: cat build_tests.bat >> ~build_tests.bat ) else ( echo "cannot find %MSVS_VSVARS_PATH%" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" & dir - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\" & dir exit /B 1 ) @@ -176,15 +180,17 @@ jobs: RUN_SCRIPT: run_tests.bat SETUP_SCRIPT: | set MSVS_VSVARS_PATH="C:\PROGRA~2\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - vswhere -latest + if exist %MSVS_VSVARS_PATH% ( + ) else ( + vswhere -latest + set MSVS_VSVARS_PATH="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + ) echo %MSVS_VSVARS_PATH% if exist %MSVS_VSVARS_PATH% ( echo call %MSVS_VSVARS_PATH% > ~build_tests.bat cat build_tests.bat >> ~build_tests.bat ) else ( echo "cannot find %MSVS_VSVARS_PATH%" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" & dir - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\" & dir exit /B 1 ) @@ -198,7 +204,11 @@ jobs: RUN_SCRIPT: run_tests.bat SETUP_SCRIPT: | set MSVS_VSVARS_PATH="C:\PROGRA~2\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - vswhere -latest + if exist %MSVS_VSVARS_PATH% ( + ) else ( + vswhere -latest + set MSVS_VSVARS_PATH="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + ) echo %MSVS_VSVARS_PATH% if exist %MSVS_VSVARS_PATH% ( echo call %MSVS_VSVARS_PATH% > ~build_tests.bat @@ -206,8 +216,6 @@ jobs: cat build_tests.bat >> ~build_tests.bat ) else ( echo "cannot find %MSVS_VSVARS_PATH%" - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" & dir - cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\" & dir exit /B 1 )