build GUI with oldest and newest available Qt5 version (#3225)

This commit is contained in:
Oliver Stöneberg 2021-10-09 16:09:20 +02:00 committed by GitHub
parent 3f8e523c71
commit dd0f617d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 11 deletions

View File

@ -15,9 +15,9 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
# windows 2016 should default to VS 2017. Not supported by setup-msbuild
os: [windows-2019] os: [windows-2019]
arch: [x64, x86] arch: [x64, x86]
qt_ver: ['', 5.9.9, 5.15.2]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -26,11 +26,13 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python 3.9 - name: Set up Python 3.9
if: matrix.qt_ver == ''
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.9
- name: Setup msbuild.exe - name: Setup msbuild.exe
if: matrix.qt_ver == ''
uses: microsoft/setup-msbuild@v1.0.2 uses: microsoft/setup-msbuild@v1.0.2
- name: Install PCRE - name: Install PCRE
@ -62,20 +64,22 @@ jobs:
Z3_VERSION: 4.8.10 Z3_VERSION: 4.8.10
# no 32-bit Qt available # no 32-bit Qt available
- name: Install Qt - name: Install Qt ${{ matrix.qt_ver }}
if: matrix.arch == 'x64' if: matrix.qt_ver != '' && matrix.arch == 'x64'
uses: jurplel/install-qt-action@v2 uses: jurplel/install-qt-action@v2
with: with:
version: ${{ matrix.qt_ver }}
modules: 'qtcharts' modules: 'qtcharts'
- name: Install missing Python packages - name: Install missing Python packages
if: matrix.qt_ver == ''
run: | run: |
python -m pip install pip --upgrade python -m pip install pip --upgrade || exit /b !errorlevel!
python -m pip install pytest python -m pip install pytest || exit /b !errorlevel!
python -m pip install pytest-custom_exit_code python -m pip install pytest-custom_exit_code || exit /b !errorlevel!
- name: Build GUI release - name: Build GUI release
if: matrix.arch == 'x64' if: matrix.qt_ver != '' && matrix.arch == 'x64'
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! 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! cd gui || exit /b !errorlevel!
@ -85,13 +89,14 @@ jobs:
CL: /MP CL: /MP
- name: Deploy GUI - name: Deploy GUI
if: matrix.arch == 'x64' if: matrix.qt_ver != '' && matrix.arch == 'x64'
run: | run: |
windeployqt Build\gui || exit /b !errorlevel! windeployqt Build\gui || exit /b !errorlevel!
del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel! del Build\gui\cppcheck-gui.ilk || exit /b !errorlevel!
del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel! del Build\gui\cppcheck-gui.pdb || exit /b !errorlevel!
- name: Configure MSBuild - name: Configure MSBuild
if: matrix.qt_ver == ''
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
set ARCH=${{ matrix.arch }} set ARCH=${{ matrix.arch }}
@ -101,27 +106,30 @@ jobs:
rm -rf build rm -rf build
mkdir build mkdir build
cd build cd build
cmake -DBUILD_TESTS=On .. cmake -DBUILD_TESTS=On .. || exit /b !errorlevel!
- name: Build CLI debug configuration using MSBuild - name: Build CLI debug configuration using MSBuild
if: matrix.qt_ver == ''
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
set ARCH=${{ matrix.arch }} set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" ( if "${{ matrix.arch }}" == "x86" (
set ARCH=Win32 set ARCH=Win32
) )
cmake --build build --target check --config Debug cmake --build build --target check --config Debug || exit /b !errorlevel!
- name: Build CLI release configuration using MSBuild - name: Build CLI release configuration using MSBuild
if: matrix.qt_ver == ''
run: | run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel! call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} || exit /b !errorlevel!
set ARCH=${{ matrix.arch }} set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" ( if "${{ matrix.arch }}" == "x86" (
set ARCH=Win32 set ARCH=Win32
) )
cmake --build build --target check --config Release cmake --build build --target check --config Release || exit /b !errorlevel!
- name: Run test/cli - name: Run test/cli
if: matrix.qt_ver == ''
run: | run: |
:: since FILESDIR is not set copy the binary to the root so the addons are found :: 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!
@ -134,6 +142,7 @@ jobs:
python -m pytest test-suppress-syntaxError.py || exit /b !errorlevel! python -m pytest test-suppress-syntaxError.py || exit /b !errorlevel!
- name: Test addons - name: Test addons
if: matrix.qt_ver == ''
run: | run: |
.\cppcheck.exe --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c .\cppcheck.exe --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c
cd addons\test cd addons\test