Travis test 1.

This commit is contained in:
Peter Fabian 2018-09-21 15:06:16 +02:00
parent e0757beafc
commit 75b01556ab
4 changed files with 48 additions and 1 deletions

View File

@ -1,7 +1,25 @@
sudo: false
language: node_js
language: php
php:
- 5.6
- 7.0
- 7.1
env:
- WP_VERSION=latest WP_MULTISITE=0
before_script:
- phpenv config-rm xdebug.ini
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- bash bin/install-wp-tests.sh wc_admin_test root '' localhost $WP_VERSION
- bash bin/travis.sh before
node_js:
- "8"
script:
- npm run lint
- npm test
- bash bin/phpunit.sh
- bash bin/phpcs.sh

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [[ ${RUN_PHPCS} == 1 ]]; then
CHANGED_FILES=`git diff --name-only --diff-filter=ACMR $TRAVIS_COMMIT_RANGE | grep \\\\.php | awk '{print}' ORS=' '`
IGNORE="tests/cli/,apigen/,includes/gateways/simplify-commerce/includes/,includes/libraries/,includes/api/legacy/"
if [ "$CHANGED_FILES" != "" ]; then
echo "Running Code Sniffer."
./vendor/bin/phpcs --ignore=$IGNORE --encoding=utf-8 -n -p $CHANGED_FILES
fi
fi

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [[ ${RUN_CODE_COVERAGE} == 1 ]]; then
phpdbg -qrr -d memory_limit=-1 $HOME/.composer/vendor/bin/phpunit -c phpunit.xml --coverage-clover=coverage.clover --exclude-group=timeout
else
phpunit -c phpunit.xml
fi

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# usage: travis.sh before|after
if [ $1 == 'before' ]; then
composer global require "phpunit/phpunit=6.*"
if [[ ${RUN_PHPCS} == 1 ]]; then
composer install
fi
fi