]> granicus.if.org Git - libevent/commitdiff
appveyor: cache build directory to reduce overall time (6x time faster)
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 5 Nov 2018 14:04:47 +0000 (17:04 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 6 Nov 2018 08:14:22 +0000 (11:14 +0300)
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).

appveyor.yml

index 0208360308f9259ef77c501e1d3aab442fe647b4..d717d012f75e88e350e250ed52c9b342e3e88248 100644 (file)
@@ -8,6 +8,7 @@ branches:
 
 environment:
   global:
+    APPVEYOR_SAVE_CACHE_ON_ERROR: true
     CYG_ROOT: C:/MinGW/msys/1.0
     EVENT_TESTS_PARALLEL: 20
   matrix:
@@ -67,16 +68,20 @@ build_script:
         bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab"
         bash -lc "echo 'C:\OpenSSL-Win32 /ssl' >> /etc/fstab"
         $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 {
-        md build
-        cd build
+        md build-cmake 2> $null
+        cd build-cmake
         cmake .. $env:EVENT_CMAKE_OPTIONS
         cmake --build .
         $env:CTEST_PARALLEL_LEVEL=$env:EVENT_TESTS_PARALLEL
         ctest --output-on-failure
       }
 
+cache:
+  - build-cmake
+  - build-autotools
+
 on_failure:
   - 7z a libevent.zip .
   - appveyor PushArtifact libevent.zip