From ec5f21d1f8f62772b10ab6beb1e22be55a7a22e6 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 11 May 2018 15:30:48 +0200 Subject: [PATCH] travis: build in Debian sid Docker container --- .travis.yml | 22 +++++----------------- travis/Dockerfile | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 travis/Dockerfile diff --git a/.travis.yml b/.travis.yml index c9db585..15ad1e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ # Use Ubuntu 14.04 (trusty), as per http://blog.travis-ci.com/2015-10-14-opening-up-ubuntu-trusty-beta/ -sudo: required +sudo: false dist: trusty +services: + - docker language: c compiler: - gcc @@ -9,21 +11,7 @@ addons: apt: packages: - clang-format-3.5 - - pkg-config - - libpam0g-dev - - libcairo2-dev - - libxcb1-dev - - libxcb-dpms0-dev - - libxcb-image0-dev - - libxcb-util0-dev - - libev-dev - - libxcb-xinerama0-dev - - libxcb-xkb-dev -before_install: - - "echo 'APT::Default-Release \"trusty\";' | sudo tee /etc/apt/apt.conf.d/default-release" - - "echo 'deb http://archive.ubuntu.com/ubuntu/ xenial main universe' | sudo tee /etc/apt/sources.list.d/wily.list" - - sudo apt-get update - - sudo apt-get --force-yes -y install -t xenial libxkbcommon-dev libxkbcommon-x11-dev script: - - autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" - clang-format-3.5 -i *.[ch] && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false) + - docker build --pull --no-cache --rm -t=i3lock -f travis/Dockerfile . + - docker run -e CC=$CC -v $PWD:/usr/src:rw i3lock /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j V=1 CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"' diff --git a/travis/Dockerfile b/travis/Dockerfile new file mode 100644 index 0000000..5381276 --- /dev/null +++ b/travis/Dockerfile @@ -0,0 +1,25 @@ +# vim:ft=Dockerfile +FROM debian:sid + +RUN echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup +# Paper over occasional network flakiness of some mirrors. +RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry + +# NOTE: I tried exclusively using gce_debian_mirror.storage.googleapis.com +# instead of httpredir.debian.org, but the results (Fetched 123 MB in 36s (3357 +# kB/s)) are not any better than httpredir.debian.org (Fetched 123 MB in 34s +# (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. + +# Install mk-build-deps (for installing the i3 build dependencies), +# clang and clang-format-3.8 (for checking formatting and building with clang), +# lintian (for checking spelling errors), +# test suite dependencies (for running tests) +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential clang git autoconf automake libxcb-randr0-dev pkg-config libpam0g-dev \ + libcairo2-dev libxcb1-dev libxcb-dpms0-dev libxcb-image0-dev libxcb-util0-dev \ + libxcb-xrm-dev libev-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev \ + libxkbcommon-x11-dev && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /usr/src