Skip to content
Snippets Groups Projects

Add PHPCS and update accordingly

Merged Erick Hitter requested to merge add/ci into master
Files
2
+ 21
51
@@ -3,63 +3,33 @@ variables:
@@ -3,63 +3,33 @@ variables:
MYSQL_DATABASE: wordpress_tests
MYSQL_DATABASE: wordpress_tests
MYSQL_ROOT_PASSWORD: mysql
MYSQL_ROOT_PASSWORD: mysql
before_script:
cache:
# Install dependencies
paths:
- $HOME/.composer
# update the docker
- /root/.composer
- apt-get clean
- apt-get -yqq update
# instll the required packages for the running CI tests
- apt-get -yqqf install zip unzip subversion mysql-client libmysqlclient-dev --fix-missing
# PHP extensions
- docker-php-ext-enable mbstring mcrypt mysqli pdo_mysql intl gd zip bz2
 
before_script:
# Set up WordPress tests
# Set up WordPress tests
- bash bin/install-wp-tests.sh wordpress_tests root mysql mysql latest true
- bash bin/install-wp-tests.sh $MYSQL_DATABASE root $MYSQL_ROOT_PASSWORD mysql latest true
# Install PHPCS and WPCS
- composer global require "squizlabs/php_codesniffer=*"
- composer global require "wp-coding-standards/wpcs"
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
PHPunit:PHP5.3:MySQL:
image: tetraweb/php:5.3
services:
- mysql:5.6
script:
- phpcs
- phpunit
PHPunit:PHP5.6:MySQL:
# PHPUnit
image: tetraweb/php:5.6
- |
services:
if [[ $(php -v) =~ "PHP 7." ]]; then
- mysql:5.6
composer global require "phpunit/phpunit=6.1.*"
script:
else
- phpcs
composer global require "phpunit/phpunit=4.8.*"
- phpunit
fi
PHPunit:PHP7.0:MySQL:
image: tetraweb/php:7.0
services:
- mysql:5.6
script:
- phpcs
- phpunit
PHPunit:PHP7.1:MySQL:
# Install PHPCS and WPCS
image: tetraweb/php:7.1
- composer global require automattic/vipwpcs
services:
- composer global require phpcompatibility/phpcompatibility-wp
- mysql:5.6
- phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/automattic/vipwpcs,$HOME/.composer/vendor/phpcompatibility/php-compatibility,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-paragonie,$HOME/.composer/vendor/phpcompatibility/phpcompatibility-wp
script:
- phpcs
- phpunit
PHPunit:PHP7.2:MySQL:
PHPunit:PHP7.2:MySQL:
image: tetraweb/php:7.2
image: containers.ethitter.com:443/docker/images/php:7.2
services:
services:
- mysql:5.6
- mysql:5.6
script:
script:
- phpcs
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
- phpcs -n
 
- phpunit
Loading