appveyor: cache build directory to reduce overall time (6x time faster)

various build checks (i.e. detecting headers/macroses/functions) takes
7 minutes (from 13 minutes in total) for cmake, which is too high.

By using cache we can reduce this to ~0.

And set APPVEYOR_SAVE_CACHE_ON_ERROR so that cmake checks will be
cached (anyway all sources will be built from scratch due to timestamp
updates while extracting from sources).

(cherry picked from commit 54fdd6bb6ebe6b0a672c79d30a712d97536500c8)
This commit is contained in:
Azat Khuzhin 2018-11-05 17:04:47 +03:00 committed by Azat Khuzhin
parent 2ffa59da04
commit cb8b6f17b2
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -8,6 +8,7 @@ branches:
environment: environment:
global: global:
APPVEYOR_SAVE_CACHE_ON_ERROR: true
CYG_ROOT: C:/MinGW/msys/1.0 CYG_ROOT: C:/MinGW/msys/1.0
EVENT_TESTS_PARALLEL: 20 EVENT_TESTS_PARALLEL: 20
matrix: matrix:
@ -67,16 +68,20 @@ build_script:
bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab" bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab"
bash -lc "echo 'C:\OpenSSL-Win32 /ssl' >> /etc/fstab" bash -lc "echo 'C:\OpenSSL-Win32 /ssl' >> /etc/fstab"
$env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/" $env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/"
bash -lc "exec 0</dev/null; exec 2>&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && ./configure LDFLAGS='-L/ssl -L/ssl/lib -L/ssl/lib/MinGW' CFLAGS=-I/ssl/include $env:EVENT_CONFIGURE_OPTIONS && make && make verify -j$env:EVENT_TESTS_PARALLEL" bash -lc "exec 0</dev/null; exec 2>&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && mkdir -p build-autotools && cd build-autotools && ../configure LDFLAGS='-L/ssl -L/ssl/lib -L/ssl/lib/MinGW' CFLAGS=-I/ssl/include $env:EVENT_CONFIGURE_OPTIONS && make && make verify -j$env:EVENT_TESTS_PARALLEL"
} else { } else {
md build md build-cmake 2> $null
cd build cd build-cmake
cmake .. $env:EVENT_CMAKE_OPTIONS cmake .. $env:EVENT_CMAKE_OPTIONS
cmake --build . cmake --build .
$env:CTEST_PARALLEL_LEVEL=$env:EVENT_TESTS_PARALLEL $env:CTEST_PARALLEL_LEVEL=$env:EVENT_TESTS_PARALLEL
ctest --output-on-failure ctest --output-on-failure
} }
cache:
- build-cmake
- build-autotools
on_failure: on_failure:
- 7z a libevent.zip . - 7z a libevent.zip .
- appveyor PushArtifact libevent.zip - appveyor PushArtifact libevent.zip