summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-09-11 20:58:10 +0000
committerDerek Schuff <dschuff@chromium.org>2017-09-11 13:58:10 -0700
commit999232d4b634b3af7217835d66689d5f82e8679a (patch)
tree7b733fd509b585cf95a694f5130fea33eea58aaf
parent13bccf058972660d7d59e68c08c0278c1554a19b (diff)
downloadbinaryen-999232d4b634b3af7217835d66689d5f82e8679a.tar.gz
binaryen-999232d4b634b3af7217835d66689d5f82e8679a.tar.bz2
binaryen-999232d4b634b3af7217835d66689d5f82e8679a.zip
Travis: Run build stage only for master and release tags (#1173)
Fixes #1161. In popular OSS projects major parts of builds is usually triggered by pull requests. So I think it should be sufficient to disable build stage for pull requests and let them run only on master branch and release tags. This is IMO better than run them only periodically by cron.
-rw-r--r--.travis.yml22
1 files changed, 18 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 81b6558f1..297925116 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -66,9 +66,11 @@ jobs:
compiler: gcc
env: ARCH=x86_64
before_install:
- - "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.6.0/alpine-chroot-install' \
- && echo 'a827a4ba3d0817e7c88bae17fe34e50204983d1e alpine-chroot-install' | sha1sum -c || exit 1"
- - alpine() { /alpine/enter-chroot -u "$USER" "$@"; }
+ - &download-alpine-script
+ "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.6.0/alpine-chroot-install' \
+ && echo 'a827a4ba3d0817e7c88bae17fe34e50204983d1e alpine-chroot-install' | sha1sum -c || travis_terminate 1"
+ - &define-alpine-func
+ alpine() { /alpine/enter-chroot -u "$USER" "$@"; }
install:
- sudo sh alpine-chroot-install -a "$ARCH" -p 'build-base cmake git nodejs python2'
before_script:
@@ -86,6 +88,18 @@ jobs:
<<: *test-alpine
stage: build
env: ARCH=x86_64
+ before_install:
+ # XXX: This is ugly hack to skip this job (and all derived) for pull
+ # requests, run it only on master branch and tags (to cut down build
+ # time). Replace it after Travis finally implement proper support for
+ # conditional jobs or stages.
+ - if [[ "$TRAVIS_PULL_REQUEST" != "false" || ( "$TRAVIS_BRANCH" != "master" && -z "$TRAVIS_TAG" ) ]]; then
+ travis_terminate 0;
+ fi
+ - *download-alpine-script
+ - *define-alpine-func
+ # Don't run before_script inherited from *test-alpine.
+ before_script: skip
script:
- alpine cmake -DCMAKE_BUILD_TYPE=Release
-DCMAKE_VERBOSE_MAKEFILE=ON
@@ -96,7 +110,7 @@ jobs:
- alpine ls -lh bin/
# Check if the built executables are really statically linked.
- if [ -n "$(find bin/ -type f -perm -u=x -exec file {} + | grep -Fvw 'statically linked')" ]; then
- file bin/*; exit 1;
+ file bin/*; false;
fi
before_deploy:
- PKGNAME="binaryen-$TRAVIS_TAG-$ARCH-linux"