]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add a travis-build container, for running locally
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 1 Apr 2018 11:53:02 +0000 (13:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 23 Apr 2018 19:51:15 +0000 (21:51 +0200)
This is not the actual Travis docker container, but it
should be similar enough for doing local verification:

make travis
make travis CC=clang
make travis CC=clang CFLAGS="-fsanitize=address -g" ASAN_OPTIONS="detect_leaks=0"
make travis CC=i686-w64-mingw32-gcc HOST="--host=i686-w64-mingw32" TEST="unittest/run.exe"

.travis/Dockerfile [new file with mode: 0644]
dev.mk.in

diff --git a/.travis/Dockerfile b/.travis/Dockerfile
new file mode 100644 (file)
index 0000000..f9cbd03
--- /dev/null
@@ -0,0 +1,26 @@
+# NOTE: This is not the real Docker image used for the Travis builds.
+#       See: https://docs.travis-ci.com/user/common-build-problems/
+
+FROM ubuntu:trusty
+
+# https://github.com/Yelp/dumb-init
+ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64.deb .
+RUN dpkg -i dumb-init_*.deb
+ENTRYPOINT ["/usr/bin/dumb-init", "--"]
+
+# generic tools
+RUN apt-get -qq update && apt-get install -y --no-install-recommends \
+                libc6-dev \
+                gcc \
+                clang \
+                gcc-mingw-w64 \
+                make \
+                autoconf \
+        && rm -rf /var/lib/apt/lists/*
+
+# ccache specific
+RUN apt-get -qq update && apt-get install -y --no-install-recommends \
+                gperf \
+                elfutils \
+                zlib1g-dev \
+        && rm -rf /var/lib/apt/lists/*
index 91b0a578afc7746199a7a8d07f56e0f505178fc7..957f846d5a16f1c11bb03249c389fc4db7aa3795 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -10,6 +10,7 @@ CPPCHECK_SUPPRESSIONS = misc/cppcheck-suppressions.txt
 SCAN_BUILD = scan-build
 DOCKER = docker
 GPERF = gperf
+TEST = test
 
 version := \
     $(shell (git --git-dir=$(srcdir)/.git describe --dirty || git --git-dir=$(srcdir)/.git describe || echo vunknown) \
@@ -203,4 +204,10 @@ analyze:
 docker: misc/Dockerfile
        $(DOCKER) build -f $< $(srcdir)
 
+.PHONY: travis
+travis: .travis/Dockerfile
+       $(DOCKER) inspect travis-build >/dev/null || $(DOCKER) build -t travis-build .travis
+       $(DOCKER) run --rm --volume $(PWD):/src --tmpfs /dst:rw,exec travis-build \
+       sh -c "cd /src && ./autogen.sh && cd /dst && CC=$(CC) CFLAGS='$(CFLAGS)' ASAN_OPTIONS='$(ASAN_OPTIONS)' /src/configure $(HOST) && make $(TEST)"
+
 -include .deps/*.d