From 526d39f3b22bab993ac76d3ea09bb0d3d420dcae Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 4 Feb 2022 14:21:21 +0100 Subject: [PATCH 1/4] CI-windows.yml: set up a whole Visual Studio environment once instead doing it manually per step --- .github/workflows/CI-windows.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index baa431afd8c..cd6d3e12e94 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -38,9 +38,10 @@ jobs: with: python-version: '3.10' - - name: Setup msbuild.exe - if: matrix.qt_ver == '' - uses: microsoft/setup-msbuild@v1.0.2 + - name: Set up Visual Studio environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} - name: Cache PCRE id: cache-pcre @@ -58,7 +59,6 @@ jobs: - name: Install PCRE if: matrix.arch == 'x64' || matrix.qt_ver == '' run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! 7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel! cd pcre-%PCRE_VERSION% || exit /b !errorlevel! cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off || exit /b !errorlevel! @@ -118,7 +118,6 @@ jobs: - name: Build GUI release if: matrix.qt_ver != '' && matrix.arch == 'x64' run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! cd gui || exit /b !errorlevel! qmake HAVE_QCHART=yes || exit /b !errorlevel! nmake release || exit /b !errorlevel! @@ -135,7 +134,6 @@ jobs: - name: Configure MSBuild if: matrix.qt_ver == '' run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! set ARCH=${{ matrix.arch }} if "${{ matrix.arch }}" == "x86" ( set ARCH=Win32 @@ -148,7 +146,6 @@ jobs: - name: Build CLI debug configuration using MSBuild if: matrix.qt_ver == '' run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! set ARCH=${{ matrix.arch }} if "${{ matrix.arch }}" == "x86" ( set ARCH=Win32 @@ -158,7 +155,6 @@ jobs: - name: Build CLI release configuration using MSBuild if: matrix.qt_ver == '' run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! set ARCH=${{ matrix.arch }} if "${{ matrix.arch }}" == "x86" ( set ARCH=Win32 From c6bde2d0ba097031d45e727ba3271f1711cedf2f Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 4 Feb 2022 14:22:14 +0100 Subject: [PATCH 2/4] CI-windows.yml: restored the actual MSBuild usage for now - CMake will be added back later --- .github/workflows/CI-windows.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index cd6d3e12e94..a0ac57027b5 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -131,8 +131,8 @@ jobs: del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel! del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel! - - name: Configure MSBuild - if: matrix.qt_ver == '' + - name: Run CMake + if: false && matrix.qt_ver == '' run: | set ARCH=${{ matrix.arch }} if "${{ matrix.arch }}" == "x86" ( @@ -150,7 +150,12 @@ jobs: if "${{ matrix.arch }}" == "x86" ( set ARCH=Win32 ) - cmake --build build --target check --config Debug || exit /b !errorlevel! + :: cmake --build build --target check --config Debug || exit /b !errorlevel! + msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel! + + - name: Run Debug test + if: matrix.qt_ver == '' + run: .\bin\debug\testrunner.exe || exit /b !errorlevel! - name: Build CLI release configuration using MSBuild if: matrix.qt_ver == '' @@ -159,13 +164,20 @@ jobs: if "${{ matrix.arch }}" == "x86" ( set ARCH=Win32 ) - cmake --build build --target check --config Release || exit /b !errorlevel! + :: cmake --build build --target check --config Release || exit /b !errorlevel! + msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel! + + - name: Run Release test + if: matrix.qt_ver == '' + run: .\bin\testrunner.exe || exit /b !errorlevel! - name: Run test/cli if: matrix.qt_ver == '' run: | :: since FILESDIR is not set copy the binary to the root so the addons are found - copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel! + :: copy .\build\bin\Release\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel! + copy .\bin\cppcheck.exe .\cppcheck.exe || exit /b !errorlevel! + copy .\bin\cppcheck-core.dll .\cppcheck-core.dll || exit /b !errorlevel! cd test/cli || exit /b !errorlevel! :: python -m pytest --suppress-no-test-exit-code test-clang-import.py || exit /b !errorlevel! python -m pytest test-helloworld.py || exit /b !errorlevel! From acd473e0144d275225ab4d77413e8b7b6d038d15 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 4 Feb 2022 14:23:55 +0100 Subject: [PATCH 3/4] CI-windows.yml: removed Qt 5.9.9 it has been EOL since 31 May 2020 and will be implicitly tested via the unix platforms. --- .github/workflows/CI-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index a0ac57027b5..a091526a256 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -17,7 +17,7 @@ jobs: matrix: os: [windows-2019] arch: [x64, x86] - qt_ver: ['', 5.9.9, 5.15.2] + qt_ver: ['', 5.15.2] fail-fast: false runs-on: ${{ matrix.os }} From ee8d1edce093edc869fa8d40e61d159f40fa26f6 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 4 Feb 2022 14:24:20 +0100 Subject: [PATCH 4/4] CI-windows.yml: added windows-2022 --- .github/workflows/CI-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index a091526a256..84e520d34e6 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -15,7 +15,7 @@ jobs: build: strategy: matrix: - os: [windows-2019] + os: [windows-2019, windows-2022] arch: [x64, x86] qt_ver: ['', 5.15.2] fail-fast: false