From 509b35a19f5e707a0827a431c9e56d6f491ab8c1 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 30 Dec 2014 07:43:32 -0500 Subject: [PATCH 1/6] Opt in to container-based Travis CI builds This should speed up our builds by providing lower latency, better caching, and more resources on the build machine. See http://docs.travis-ci.com/user/workers/container-based-infrastructure/. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index e49ae8a6..0bb60273 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +sudo: false before_install: - git fetch origin master:master - git fetch origin v2.0.0:v2.0.0 From 84235478ef65c4e3d5746a00aa1e48fc260a713f Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 30 Dec 2014 07:55:42 -0500 Subject: [PATCH 2/6] Download and install libicu-dev without using sudo We tell apt-get to download it to vendor/apt and then install it into a vendor/icu directory. We should be able to just specify --with-icu-dir, but apparently Ruby 2.0 (but not 1.9 or 2.1 or 2.2) has a bug that requires us to use --with-icu-include/--with-icu-lib instead. Otherwise it can't find the ICU libraries. --- .travis.yml | 3 ++- script/vendor-deb | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 script/vendor-deb diff --git a/.travis.yml b/.travis.yml index 0bb60273..5fc60617 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,8 @@ before_install: - git fetch origin v2.0.0:v2.0.0 - git fetch origin test/attributes:test/attributes - git fetch origin test/master:test/master - - sudo apt-get install libicu-dev -y + - script/vendor-deb libicu48 libicu-dev + - bundle config build.charlock_holmes --with-icu-include=$(pwd)/vendor/debs/include --with-icu-lib=$(pwd)/vendor/debs/lib - git submodule init - git submodule sync --quiet - script/fast-submodule-update diff --git a/script/vendor-deb b/script/vendor-deb new file mode 100755 index 00000000..ebad3e76 --- /dev/null +++ b/script/vendor-deb @@ -0,0 +1,13 @@ +#!/bin/sh + +set -ex + +cd "$(dirname "$0")/.." + +mkdir -p vendor/apt vendor/debs + +(cd vendor/apt && apt-get --assume-yes download "$@") + +for deb in vendor/apt/*.deb; do + ar p $deb data.tar.gz | tar -vzxC vendor/debs --strip-components=2 +done From d42ad45423fdabc3b167d6ebaa3d70ff09a39de2 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 30 Dec 2014 10:00:39 -0500 Subject: [PATCH 3/6] Turn on the bundler cache This should allow us to skip installing gems in most builds, shaving off ~40 seconds. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5fc60617..2eec3572 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,3 +18,4 @@ notifications: disabled: true git: submodules: false +cache: bundler From d258d146b8de4a3dffb630dd4a97042d5e9b069b Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 6 Jan 2015 12:41:00 -0500 Subject: [PATCH 4/6] Move before_install steps to a separate script --- .travis.yml | 11 +---------- script/travis/before_install | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) create mode 100755 script/travis/before_install diff --git a/.travis.yml b/.travis.yml index 2eec3572..4d0c2351 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,5 @@ sudo: false -before_install: - - git fetch origin master:master - - git fetch origin v2.0.0:v2.0.0 - - git fetch origin test/attributes:test/attributes - - git fetch origin test/master:test/master - - script/vendor-deb libicu48 libicu-dev - - bundle config build.charlock_holmes --with-icu-include=$(pwd)/vendor/debs/include --with-icu-lib=$(pwd)/vendor/debs/lib - - git submodule init - - git submodule sync --quiet - - script/fast-submodule-update +before_install: script/travis/before_install rvm: - 1.9.3 - 2.0.0 diff --git a/script/travis/before_install b/script/travis/before_install new file mode 100755 index 00000000..3604b14d --- /dev/null +++ b/script/travis/before_install @@ -0,0 +1,15 @@ +#!/bin/sh + +set -ex + +git fetch origin master:master +git fetch origin v2.0.0:v2.0.0 +git fetch origin test/attributes:test/attributes +git fetch origin test/master:test/master + +script/vendor-deb libicu48 libicu-dev +bundle config build.charlock_holmes --with-icu-include=$(pwd)/vendor/debs/include --with-icu-lib=$(pwd)/vendor/debs/lib + +git submodule init +git submodule sync --quiet +script/fast-submodule-update From d82e4801ffa7fdebdd78d7a67bdb674bcc88fdeb Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 6 Jan 2015 12:44:39 -0500 Subject: [PATCH 5/6] Use --with-icu-dir everywhere but Ruby 2.0 --with-icu-dir is broken on Ruby 2.0 due to https://bugs.ruby-lang.org/issues/8074. Specifying --with-icu-include/--with-icu-lib is broken on Ruby 2.1 and newer due to https://github.com/bundler/bundler/pull/3338. So now we use --with-icu-dir everywhere but Ruby 2.0. --- script/travis/before_install | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/travis/before_install b/script/travis/before_install index 3604b14d..d7274654 100755 --- a/script/travis/before_install +++ b/script/travis/before_install @@ -8,7 +8,14 @@ git fetch origin test/attributes:test/attributes git fetch origin test/master:test/master script/vendor-deb libicu48 libicu-dev -bundle config build.charlock_holmes --with-icu-include=$(pwd)/vendor/debs/include --with-icu-lib=$(pwd)/vendor/debs/lib +if ruby -e 'exit RUBY_VERSION >= "2.0" && RUBY_VERSION < "2.1"'; then + # Workaround for https://bugs.ruby-lang.org/issues/8074. We can't use this + # solution on all versions of Ruby due to + # https://github.com/bundler/bundler/pull/3338. + bundle config build.charlock_holmes --with-icu-include=$(pwd)/vendor/debs/include --with-icu-lib=$(pwd)/vendor/debs/lib +else + bundle config build.charlock_holmes --with-icu-dir=$(pwd)/vendor/debs +fi git submodule init git submodule sync --quiet From 188e579df7ef2c34615a311312851759dc8bc7a5 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 6 Jan 2015 12:56:08 -0500 Subject: [PATCH 6/6] Use a single `git fetch` invocation in CI --- script/travis/before_install | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/script/travis/before_install b/script/travis/before_install index d7274654..442f6718 100755 --- a/script/travis/before_install +++ b/script/travis/before_install @@ -2,10 +2,8 @@ set -ex -git fetch origin master:master -git fetch origin v2.0.0:v2.0.0 -git fetch origin test/attributes:test/attributes -git fetch origin test/master:test/master +# Fetch all commits/refs needed to run our tests. +git fetch origin master:master v2.0.0:v2.0.0 test/attributes:test/attributes test/master:test/master script/vendor-deb libicu48 libicu-dev if ruby -e 'exit RUBY_VERSION >= "2.0" && RUBY_VERSION < "2.1"'; then