diff --git a/.travis.yml b/.travis.yml index cddd721429..1cbc661b72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: trusty +dist: xenial language: java before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock @@ -12,10 +12,18 @@ env: - RUN_BARCLAY_TESTS=true - RUN_BARCLAY_TESTS=false jdk: - - oraclejdk8 + # oraclejdk8 - Xenial does not support oraclejdk8 - openjdk8 - openjdk11 before_install: + #skip push builds if there's an associated PR because we don't look at them anway + - if [[ ${TRAVIS_EVENT_TYPE} == push ]]; then + PULL_REQUESTS=$( scripts/travis/check_for_pull_request ); + if [[ $( grep -c "commits" <<< ${PULL_REQUESTS} ) -gt 0 ]]; then + echo "WARNING TEST SKIPPED. TESTS DO NOT RUN ON BRANCHES WITH OPEN PULL REQUESTS. SEE PULL REQUEST FOR TEST RESULTS"; + travis_terminate 0; + fi; + fi; - wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - sudo apt-get -qq update - sudo apt-get install -y --no-install-recommends r-base-dev r-recommended qpdf diff --git a/scripts/travis/check_for_pull_request b/scripts/travis/check_for_pull_request new file mode 100755 index 0000000000..da7ae7bbe0 --- /dev/null +++ b/scripts/travis/check_for_pull_request @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +#query github for information about a specific pull request +curl -v -H "Authorization: token $GITHUB_API_TOKEN" https://api.github.com/repos/broadinstitute/picard/pulls\?state\=open\&head="broadinstitute:${TRAVIS_BRANCH}"