.travis.yml
dist: bionic
language: php
php:
- '7.4'
services:
- mysql
addons:
apt:
packages:
- mysql-client-5.7
sonarcloud:
organization: autowp-github
token:
secure: $SONARCLOUD_TOKEN
before_script:
- composer install || travis_terminate 1;
- mysql -u root -e 'create database autowp_test;' || travis_terminate 1;
- mysql -u root < test/_files/dump.sql || travis_terminate 1;
- mysql -u root -e 'GRANT ALL PRIVILEGES ON autowp_test.* TO autowp_test@localhost IDENTIFIED BY "test";' || travis_terminate 1;
- curl -Ls https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
script:
- "./vendor/bin/phpunit --coverage-clover ./clover.xml"
after_script:
- sonar-scanner -Dsonar.login=$SONARCLOUD_TOKEN || travis_terminate 1;
- ./vendor/bin/php-coveralls -v -x ./clover.xml
- ./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT ./clover.xml