From: Alexander Lanin Date: Sun, 5 Jul 2020 19:00:05 +0000 (+0200) Subject: Run compilation and tests with multiple threads (#610) X-Git-Tag: v4.0~360 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c91850268b46b049447eec024b94d4d3bb9e40d7;p=thirdparty%2Fccache.git Run compilation and tests with multiple threads (#610) --- diff --git a/ci/build b/ci/build index 9cc44297d..5b79f2771 100755 --- a/ci/build +++ b/ci/build @@ -11,11 +11,15 @@ fi if [ -n "${SPECIAL:-}" ]; then exec "ci/$SPECIAL" else + [ -z ${JOBS+x} ] && JOBS=$(getconf _NPROCESSORS_ONLN 2>/dev/null) + [ -z ${JOBS+x} ] && JOBS=2 + mkdir -p ${BUILDDIR:-build} cd ${BUILDDIR:-build} - ${CMAKE_PREFIX:-} cmake "${CCACHE_LOC:-..}" ${CMAKE_PARAMS:-} + ${CMAKE_PREFIX:-} cmake ${CMAKE_PARAMS:-} ${CCACHE_LOC:-..} # 4 jobs seem to be a reasonable default for Travis. - ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j4 + ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j${JOBS} # Warning: Rare random failures when running with -j4. - [ "${RUN_TESTS:-1}" -ne "1" ] || ctest --output-on-failure -j1 + [ "${RUN_TESTS:-1}" -ne "1" ] || ctest --output-on-failure -j${JOBS} fi +exit 0