autowp/image

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
sudo: required
dist: bionic
language: php
php:
  - "7.4"
services:
  - mysql
  - postgresql
addons:
  apt:
    packages:
    - mysql-client-5.7
  sonarcloud:
    organization: "autowp-github"
    token:
      secure: $SONARCLOUD_TOKEN
  postgresql: '9.6'
install:
  - pear config-set preferred_state beta || travis_terminate 1;
  - pecl channel-update pecl.php.net || travis_terminate 1;
  - yes | pecl install imagick || travis_terminate 1;
  
before_script: 
  - composer install --no-progress --no-interaction --no-suggest --ignore-platform-reqs || travis_terminate 1;
  - mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql || travis_terminate 1;
  - mysql -u root -e 'create database autowp_image_test;' || travis_terminate 1;
  - mysql -u root < test/_files/dump.mysql.sql || travis_terminate 1;
  - mysql -u root -e 'GRANT ALL PRIVILEGES ON autowp_image_test.* TO autowp_test@localhost IDENTIFIED BY "test";' || travis_terminate 1;
  - psql -c 'create database autowp_image_test;' -U postgres || travis_terminate 1;
  - psql --set ON_ERROR_STOP=on -U postgres autowp_image_test < test/_files/dump.pgsql.sql || 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:
  - ./cc-test-reporter before-build || travis_terminate 1;
  - composer cs-check || travis_terminate 1;
  - composer phpmd || travis_terminate 1;
  - PDODRIVER=mysql ./vendor/bin/phpunit --exclude StorageS3Test --log-junit test/logs/junit.xml --coverage-clover ./clover.xml || travis_terminate 1;
  - sonar-scanner -Dsonar.login=$SONARCLOUD_TOKEN || true;

after_script:
  - ./vendor/bin/php-coveralls -v -x ./clover.xml
  - ./cc-test-reporter after-build -t clover --exit-code $TRAVIS_TEST_RESULT ./clover.xml