GemsTracker/gemstracker-library

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php

# list any PHP version you want to test against
matrix:
  include:
    - php: 5.6      
    - php: 7.0  
      env: WITH_COVERAGE=true
    - php: 7.1

# Commands to be run before your environment runs.
install: composer install

# Try if composer cache will speed up the build
#cache:
# directories:
#    - $HOME/.composer/cache/files
before_script:
  - if [[ "$WITH_COVERAGE" == "true" ]];
    then
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter;
        chmod +x ./cc-test-reporter;
        ./cc-test-reporter before-build;
    fi
  

# omitting "script:" will default to phpunit
script: 
  - if [[ "$WITH_COVERAGE" == "true" ]];
    then bin/phpunit --configuration tests/phpunit.xml --coverage-clover build/logs/clover.xml;
    else bin/phpunit --configuration tests/phpunit.xml;
    fi

after_script:
  - if [[ "$WITH_COVERAGE" == "true" ]]; then 
        ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
    fi
addons:
    code_climate:
        repo_token: $CODECLIMATE_REPO_TOKEN