Speed up AppVeyor build times

* Examples are no longer built for all images
* Coverage is no longer collected from every build
* The number of configurations is reduced
This commit is contained in:
Martin Hořeňovský 2018-03-06 18:33:18 +01:00
parent 9d1858b195
commit dc8a8e6371
4 changed files with 67 additions and 16 deletions

View File

@ -19,18 +19,51 @@ environment:
- additional_flags: "/D_UNICODE /DUNICODE" - additional_flags: "/D_UNICODE /DUNICODE"
wmain: 1 wmain: 1
coverage: 0
# Have a coverage dimension
- additional_flags: ""
wmain: 0
coverage: 1
# Have an examples dimension
- additional_flags: ""
wmain: 0
examples: 1
matrix: matrix:
exclude: exclude:
- os: Visual Studio 2015 - os: Visual Studio 2015
additional_flags: "/permissive- /std:c++latest" additional_flags: "/permissive- /std:c++latest"
init: - os: Visual Studio 2015
- git config --global core.autocrlf input additional_flags: "/D_UNICODE /DUNICODE"
# Exclude unwanted coverage configurations
- coverage: 1
platform: Win32
- coverage: 1
os: Visual Studio 2015
- coverage: 1
configuration: Release
# Exclude unwanted examples configurations
- examples: 1
platform: Win32
- examples: 1
os: Visual Studio 2015
- examples: 1
configuration: Release
install: install:
- ps: if (($env:CONFIGURATION) -eq "Debug" ) { python -m pip install codecov } - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { python -m pip install codecov }
- ps: if (($env:CONFIGURATION) -eq "Debug" ) { .\misc\installOpenCppCoverage.ps1 } - ps: if (($env:CONFIGURATION) -eq "Debug" -And ($env:coverage) -eq "1" ) { .\misc\installOpenCppCoverage.ps1 }
# Win32 and x64 are CMake-compatible solution platform names. # Win32 and x64 are CMake-compatible solution platform names.
# This allows us to pass %PLATFORM% to CMake -A. # This allows us to pass %PLATFORM% to CMake -A.

View File

@ -1,12 +1,26 @@
@REM # In debug build, we want to
@REM # 1) Prebuild memcheck redirecter @REM # Possibilities:
@REM # 2) Regenerate single header include for examples @REM # Debug build + coverage
@REM # 3) Enable building examples @REM # Debug build + examples
@REM # Debug build + ---
@REM # Release build
if "%CONFIGURATION%"=="Debug" ( if "%CONFIGURATION%"=="Debug" (
python scripts\generateSingleHeader.py if "%coverage%"=="1" (
cmake -Hmisc -Bbuild-misc -A%PLATFORM% @REM # coverage needs to build the special helper as well as the main
cmake --build build-misc cmake -Hmisc -Bbuild-misc -A%PLATFORM%
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=ON -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind cmake --build build-misc
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DMEMORYCHECK_COMMAND=build-misc\Debug\CoverageHelper.exe -DMEMORYCHECK_COMMAND_OPTIONS=--sep-- -DMEMORYCHECK_TYPE=Valgrind
) else (
@REM # We know that coverage is 0
if "%examples%"=="1" (
@REM # Examples live off the single header, so it needs to be regenerated
python scripts\generateSingleHeader.py
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% -DCATCH_BUILD_EXAMPLES=ON
) else (
@REM # This is just a plain debug build
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%
)
)
) )
if "%CONFIGURATION%"=="Release" ( if "%CONFIGURATION%"=="Release" (
cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain% cmake -H. -BBuild -A%PLATFORM% -DUSE_WMAIN=%wmain%

View File

@ -1,8 +1,12 @@
cd Build cd Build
if "%CONFIGURATION%"=="Debug" ( if "%CONFIGURATION%"=="Debug" (
ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck if "%coverage%"=="1" (
python ..\misc\appveyorMergeCoverageScript.py ctest -j 2 -C %CONFIGURATION% -D ExperimentalMemCheck
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN% python ..\misc\appveyorMergeCoverageScript.py
codecov --root .. --no-color --disable gcov -f cobertura.xml -t %CODECOV_TOKEN%
) else (
ctest -j 2 -C %CONFIGURATION%
)
) )
if "%CONFIGURATION%"=="Release" ( if "%CONFIGURATION%"=="Release" (
ctest -j 2 -C %CONFIGURATION% ctest -j 2 -C %CONFIGURATION%

View File

@ -1,5 +1,5 @@
# Downloads are done from the oficial github release page links # Downloads are done from the oficial github release page links
$downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.6.1/OpenCppCoverageSetup-x64-0.9.6.1.exe" $downloadUrl = "https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.7.0/OpenCppCoverageSetup-x64-0.9.7.0.exe"
$installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe") $installerPath = [System.IO.Path]::Combine($Env:USERPROFILE, "Downloads", "OpenCppCoverageSetup.exe")
if(-Not (Test-Path $installerPath)) { if(-Not (Test-Path $installerPath)) {