diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2018-02-09 01:12:16 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2018-02-09 01:12:16 +0100 |
commit | ccf2b671e65f5f8d3e0dde810b25ffafe70d70f0 (patch) | |
tree | 6d88183ab069b0d244e8ca0ba1c76ce7e1441c13 | |
parent | 5e4facc64c22438af5cfd8ce7cdc05562eea52ae (diff) | |
download | binaryen-ccf2b671e65f5f8d3e0dde810b25ffafe70d70f0.tar.gz binaryen-ccf2b671e65f5f8d3e0dde810b25ffafe70d70f0.tar.bz2 binaryen-ccf2b671e65f5f8d3e0dde810b25ffafe70d70f0.zip |
Travis: Replace hack for conditional build stage with proper method
Travis finally implemented conditional stages/jobs, yay!
See: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/
-rw-r--r-- | .travis.yml | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml index 5ac9236d3..5f51f7551 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,13 @@ sudo: false dist: trusty language: cpp +stages: + - name: test + - name: build + # Don't run build stage for pull requests and other branches than master + # to save time and resources. + if: type != pull_request AND (branch = master OR tag IS present) + jobs: include: # Build with clang and run tests on the host system (Ubuntu). @@ -75,11 +82,9 @@ jobs: compiler: gcc env: ARCH=x86_64 before_install: - - &download-alpine-script - "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.7.0/alpine-chroot-install' \ + - "wget 'https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.7.0/alpine-chroot-install' \ && echo '090d323d887ef3a2fd4e752428553f22a52b87bb alpine-chroot-install' | sha1sum -c || travis_terminate 1" - - &define-alpine-func - alpine() { /alpine/enter-chroot -u "$USER" "$@"; } + - alpine() { /alpine/enter-chroot -u "$USER" "$@"; } install: - sudo sh alpine-chroot-install -a "$ARCH" -p 'build-base cmake git nodejs python2' before_script: @@ -97,16 +102,6 @@ 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: |