diff options
-rw-r--r-- | .travis.yml | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml index 4a14875d8..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.6.0/alpine-chroot-install' \ - && echo 'a827a4ba3d0817e7c88bae17fe34e50204983d1e alpine-chroot-install' | sha1sum -c || travis_terminate 1" - - &define-alpine-func - alpine() { /alpine/enter-chroot -u "$USER" "$@"; } + - "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" + - 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: |