diff --git a/.travis.yml b/.travis.yml
index 0b96f17..986569e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,39 +1,47 @@
-# See https://github.com/silverstripe/silverstripe-travis-support for setup details
language: php
-sudo: false
-
addons:
apt:
packages:
- poppler-utils
+env:
+ global:
+ - COMPOSER_ROOT_VERSION=3.x-dev
+ - SS_TIKA_ENDPOINT="http://localhost:9998/"
+
matrix:
include:
- - php: 5.4
- env: DB=PGSQL CORE_RELEASE=3.2
- - php: 5.5
- env: DB=PGSQL CORE_RELEASE=3.3
- php: 5.6
- env: DB=PGSQL CORE_RELEASE=3.4
- - php: 5.6
- env: DB=MYSQL CORE_RELEASE=3.5
+ env: DB=MYSQL RECIPE_VERSION=1.0.x-dev PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
- env: DB=MYSQL CORE_RELEASE=3.6
+ env: DB=MYSQL RECIPE_VERSION=1.1.x-dev PHPUNIT_TEST=1
- php: 7.1
- env: DB=MYSQL CORE_RELEASE=3
+ env: DB=PGSQL RECIPE_VERSION=4.2.x-dev PHPUNIT_COVERAGE_TEST=1
+ - php: 7.2
+ env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1
before_script:
- - composer self-update || true
+ # Init PHP
+ - phpenv rehash
+ - phpenv config-rm xdebug.ini
+
+ # Configure Tika bin
- mkdir -p $HOME/bin
- export PATH=$PATH:$HOME/bin
- - export SS_TIKA_ENDPOINT="http://localhost:9998/"
- ./.travis/install_tika.sh
- - git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
- - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss
- - cd ~/builds/ss
- - composer install
+ - ($HOME/bin/tika-rest-server &) &> /dev/null
+
+ # Install composer dependencies
+ - composer validate
+ - composer require --no-update silverstripe/recipe-core "$RECIPE_VERSION"
+ - if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql 2.1.x-dev; fi
+ - composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
script:
- - ($HOME/bin/tika-rest-server &) &> /dev/null
- - vendor/bin/phpunit --verbose textextraction/tests/
+ - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
+ - if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
+ - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi
+
+after_success:
+ - if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000..9e7c838
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,3 @@
+comment: false
+codecov:
+ branch: master
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
new file mode 100644
index 0000000..a2a2e85
--- /dev/null
+++ b/phpcs.xml.dist
@@ -0,0 +1,11 @@
+
+
+ CodeSniffer ruleset for SilverStripe coding conventions.
+
+
+
+
+
+
+
+
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
new file mode 100644
index 0000000..ff569fc
--- /dev/null
+++ b/phpunit.xml.dist
@@ -0,0 +1,14 @@
+
+
+ tests/php
+
+
+
+
+ src/
+
+ tests/
+
+
+
+