diff options
author | Alexander Lanin <alex@lanin.de> | 2020-06-14 09:59:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-14 09:59:00 +0200 |
commit | f2341b2ba3369d5641a53deb3f6b1d513a8924e2 (patch) | |
tree | 229095217e949396920dbe3b77712bef25587775 /ci | |
parent | b1fcfbca224b2af5b6499794edd8615dbc3dc7b5 (diff) | |
download | ccache-f2341b2ba3369d5641a53deb3f6b1d513a8924e2.tar.gz |
Switch to CMake (#573)
Co-authored-by: Cristian Adam <cristian.adam@gmail.com>
Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/build.sh | 15 | ||||
-rwxr-xr-x | ci/build_and_verify_package.sh | 20 | ||||
-rwxr-xr-x | ci/build_and_verify_package_source.sh | 26 |
3 files changed, 61 insertions, 0 deletions
diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 00000000..1d334e7d --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,15 @@ +#!/bin/sh -ex +# This script is used by travis.yml and docker.sh + +if [ -n "${SPECIAL}" ]; then + sh ci/${SPECIAL}.sh +else + mkdir -p ${BUILDDIR:-build} + cd ${BUILDDIR:-build} + ${CMAKE_PREFIX:-} cmake ${CCACHE_LOC:-..} ${CMAKE_PARAMS:-} + # 4 threads seems a reasonable default for Travis + ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j4 + # Warning: Rare random failures when running with j4. + test "${RUN_TESTS:-1}" -eq "1" && ctest --output-on-failure -j1 +fi +exit 0 diff --git a/ci/build_and_verify_package.sh b/ci/build_and_verify_package.sh new file mode 100755 index 00000000..bdf6acd8 --- /dev/null +++ b/ci/build_and_verify_package.sh @@ -0,0 +1,20 @@ +#!/bin/sh -ex + +echo "Warning: Binary package support is rather experimental\n" + +mkdir -p build_package_dir_test +cd build_package_dir_test +rm -rf * +cmake .. +cmake --build . --target package + +# get out of git directory just to be sure +tmp_dir=$(mktemp -d) + +tar -xzf ccache-binary.tar.gz -C $tmp_dir + +CCACHE=$tmp_dir/ccache-binary/bin/ccache ../test/run + +rm -rf $tmp_dir + +echo "\n\nbinary package is fine and can be used!\n\n" diff --git a/ci/build_and_verify_package_source.sh b/ci/build_and_verify_package_source.sh new file mode 100755 index 00000000..221f813d --- /dev/null +++ b/ci/build_and_verify_package_source.sh @@ -0,0 +1,26 @@ +#!/bin/sh -ex + +echo "Warning: Source package support is rather experimental\n" + +mkdir -p build_package_source_dir_test +cd build_package_source_dir_test +rm -rf * +cmake .. +cmake --build . --target package_source + +# get out of git directory +# Unfortunately this random name will prevent ccache from caching results... +# ToDo: use '../../temp' instead? +tmp_dir=$(mktemp -d) + +tar -xzf ccache-src.tar.gz -C $tmp_dir +cd $tmp_dir + +cmake . +cmake --build . -- -j4 +ctest --output-on-failure -j4 + +rm -rf $tmp_dir + +echo "\n\nsource package is fine and can be used!\n\n" + |