Skip to content

Commit

Permalink
Only run PR build, not the branch build (#1656)
Browse files Browse the repository at this point in the history
* Only run PR build, not the branch build

* add a check to see if a pull request is open for a branch

* trigger test again

* add some logging to the bash

* revert

* :(

* :(

* :( :( :(

* :)

* Here's hoping

* try again

* try again

* Trying the fix suggested by travis

* Add message for branch tests

* magical semicolon?

* remove oraclejdk8 tests
  • Loading branch information
jessicaway authored Apr 28, 2021
1 parent 959411f commit 380891c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: trusty
dist: xenial
language: java
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions scripts/travis/check_for_pull_request
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 380891c

Please sign in to comment.