CI-windows.yml: perform debug and release builds in separate jobs (#5392)

The Windows jobs are along the longer jobs to run (~14 minutes) by
splitting these up we reduce the peak time to about half of that.
This commit is contained in:
Oliver Stöneberg 2023-09-01 20:03:53 +02:00 committed by GitHub
parent bf5e63300e
commit 37b2e50933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -77,6 +77,7 @@ jobs:
matrix: matrix:
os: [windows-2019, windows-2022] os: [windows-2019, windows-2022]
arch: [x64, x86] arch: [x64, x86]
config: [debug, release]
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -89,6 +90,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python 3.11 - name: Set up Python 3.11
if: matrix.config == 'release'
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.11' python-version: '3.11'
@ -131,6 +133,7 @@ jobs:
CL: /MP CL: /MP
- name: Install missing Python packages - name: Install missing Python packages
if: matrix.config == 'release'
run: | run: |
python -m pip install pip --upgrade || exit /b !errorlevel! python -m pip install pip --upgrade || exit /b !errorlevel!
python -m pip install pytest || exit /b !errorlevel! python -m pip install pytest || exit /b !errorlevel!
@ -147,6 +150,7 @@ jobs:
cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel! cmake -S . -B build -DBUILD_TESTS=On || exit /b !errorlevel!
- name: Build CLI debug configuration using MSBuild - name: Build CLI debug configuration using MSBuild
if: matrix.config == 'debug'
run: | run: |
set ARCH=${{ matrix.arch }} set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" ( if "${{ matrix.arch }}" == "x86" (
@ -156,9 +160,11 @@ jobs:
msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel! msbuild -m cppcheck.sln /p:Configuration=Debug-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel!
- name: Run Debug test - name: Run Debug test
if: matrix.config == 'debug'
run: .\bin\debug\testrunner.exe || exit /b !errorlevel! run: .\bin\debug\testrunner.exe || exit /b !errorlevel!
- name: Build CLI release configuration using MSBuild - name: Build CLI release configuration using MSBuild
if: matrix.config == 'release'
run: | run: |
set ARCH=${{ matrix.arch }} set ARCH=${{ matrix.arch }}
if "${{ matrix.arch }}" == "x86" ( if "${{ matrix.arch }}" == "x86" (
@ -168,9 +174,11 @@ jobs:
msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel! msbuild -m cppcheck.sln /p:Configuration=Release-PCRE;Platform=%ARCH% -maxcpucount || exit /b !errorlevel!
- name: Run Release test - name: Run Release test
if: matrix.config == 'release'
run: .\bin\testrunner.exe || exit /b !errorlevel! run: .\bin\testrunner.exe || exit /b !errorlevel!
- name: Run test/cli - name: Run test/cli
if: matrix.config == 'release'
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!
@ -186,6 +194,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.config == 'release'
run: | run: |
.\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel! .\cppcheck --addon=threadsafety addons\test\threadsafety || exit /b !errorlevel!
.\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel! .\cppcheck --addon=threadsafety --std=c++03 addons\test\threadsafety || exit /b !errorlevel!