Revision 1c47eca3b400dc2b409834921478ace5cb922b97 authored by Denis Yuen on 13 September 2019, 21:02:27 UTC, committed by Denis Yuen on 13 September 2019, 21:02:27 UTC
1 parent 5cc6d62
Raw File
.travis.yml
sudo: required
services:
- docker

addons:
  postgresql: "9.6"

cache:
  directories:
  - /tmp/localstack_install_dir
  - $HOME/.cache/pip
  - $HOME/.m2/repository
  - $HOME/apache-maven-3.5.4
  - $HOME/apache-maven-3.6.0

dist: xenial
language: java
jdk: openjdk11

env:
  - TESTING_PROFILE=integration-tests

jobs:
  include:
    - stage: unit-tests
      env:
        - TESTING_PROFILE=unit-tests
      script: mvn --batch-mode clean install -P$TESTING_PROFILE
# moved to CircleCI (may move back if build speed improves)
#    - stage: unit-tests
#      jdk: openjdk11
#      env:
#      - TESTING_PROFILE=unit-tests
#      script: mvn --batch-mode clean install -P$TESTING_PROFILE

# moved to CircleCI (may move back if build speed improves)
#    - stage: automated-review
#      jdk: openjdk11
#      env:
#      - TESTING_PROFILE=automated-review
#      script:
#      - mvn --batch-mode clean install -DskipTests -P$TESTING_PROFILE
#      - scripts/check_migrations.sh

    - stage: coverage
      env:
        - TESTING_PROFILE=unit-tests
      script: mvn --batch-mode clean install jacoco:report jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage
    - stage: coverage
      script: mvn --batch-mode clean install jacoco:report-integration jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage -DskipITs=true
    - stage: coverage
      script: mvn --batch-mode clean install jacoco:report-integration jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage -DskipClientITs=true
      env:
        - TESTING_PROFILE=tool-integration-tests
    - stage: coverage
      script: mvn --batch-mode clean install jacoco:report-integration jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage -DskipClientITs=true
      env:
        - TESTING_PROFILE=workflow-integration-tests
    - stage: coverage
      script: mvn --batch-mode clean install jacoco:report-integration jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage -DskipClientITs=true
      env:
        - TESTING_PROFILE=other-integration-tests
        
# not feeling the bang-for-the-buck for these, running only in release branch         
#    - stage: coverage
#      script: mvn --batch-mode clean install jacoco:report-integration jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage -DskipClientITs=true
#      if: branch = master OR branch =~ /^release.*$/
#      env:
#        - TESTING_PROFILE=toil-integration-tests
    - stage: coverage
      script: mvn --batch-mode clean install jacoco:report-integration jacoco:report-aggregate coveralls:report -P$TESTING_PROFILE,coverage -DskipClientITs=true
      env:
        - TESTING_PROFILE=regression-integration-tests
      if: branch = master OR branch =~ /^release.*$/
        
# build lifecycle is before_install, install, before_script, script, before_cache, after_success/after_failure, after_script

before_install:
- export M2_HOME=$HOME/apache-maven-3.6.0
- if [ ! -d $M2_HOME/bin ]; then curl https://archive.apache.org/dist/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz | tar zxf - -C $HOME; fi
- export PATH=$M2_HOME/bin:$PATH
# see https://www.deps.co/guides/travis-ci-latest-java/
- if [ -e $JAVA_HOME/lib/security/cacerts ]; then sudo rm $JAVA_HOME/lib/security/cacerts && sudo ln -s /etc/ssl/certs/java/cacerts $JAVA_HOME/lib/security/cacerts; fi
# need to clear out old version of the plugin till everything is merged due to https://github.com/maven-download-plugin/maven-download-plugin/issues/80
- rm -Rf $HOME/.m2/repository/.cache/download-maven-plugin/
# turn this back on when npm settles down/we find a swagger2openapi replacement
#- npm install -g swagger2openapi@2.11.16
# decrypt migration before initial build
- scripts/decrypt.sh
# turn this back on with updates to swagger (particularly swagger-maven-plugin), current implementation is too non-deterministic
#- scripts/check-swagger.sh
# codacy hookup
- sudo apt-get install jq
- wget --no-verbose -O ~/codacy-coverage-reporter-assembly-latest.jar https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.5/codacy-coverage-reporter-4.0.5-assembly.jar
- pyenv global 3.6.7

install:
- docker version
- scripts/install-tests.sh

before_script:
- psql -c "create user dockstore with password 'dockstore' createdb;" -U postgres
- psql -c 'create database webservice_test with owner = dockstore;' -U postgres
- export PATH=$PATH:$PWD/dockstore-client/target
# debug by double checking versions of stuff
- mvn -version
- echo $JAVA_HOME

before_cache:
- rm -rf /home/travis/.m2/repository/io/dockstore
- rm -rf $HOME/.m2/repository/.cache/download-maven-plugin directory

after_success:
- bash <(curl -s https://codecov.io/bash) -F ${TESTING_PROFILE//-} || echo "Codecov did not collect coverage reports"
- java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r reports/target/site/jacoco-aggregate/jacoco.xml 
  
notifications:
  slack:
    on_success: never
    on_failure: always
    rooms:
    - oicr:S9k4EowgQv9AnbCfEZHSzCsg
  webhooks: https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN
back to top