Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
View All Posts Pages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WP Plugins
View All Posts Pages
Commits
09fe03dd
Commit
09fe03dd
authored
6 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Improved test config
parent
14330396
No related branches found
No related tags found
1 merge request
!1
Add PHPCS and update accordingly
Pipeline
#451
failed
6 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+21
-51
21 additions, 51 deletions
.gitlab-ci.yml
.phpcs.xml.dist
+9
-8
9 additions, 8 deletions
.phpcs.xml.dist
with
30 additions
and
59 deletions
.gitlab-ci.yml
+
21
−
51
View file @
09fe03dd
...
@@ -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
This diff is collapsed.
Click to expand it.
.phpcs.xml.dist
+
9
−
8
View file @
09fe03dd
<?xml version="1.0"?>
<?xml version="1.0"?>
<ruleset
name=
"
WordPress Coding Standards based custom ruleset for your plugin
"
>
<ruleset
name=
"
View All Posts Pages
"
>
<description>
Generally-applicable sniffs for WordPress plugins.
</description>
<description>
Generally-applicable sniffs for WordPress plugins.
</description>
<!-- What to scan -->
<!-- What to scan -->
<file>
.
</file>
<file>
.
</file>
<exclude-pattern>
/vendor/
</exclude-pattern>
<exclude-pattern>
/vendor/
</exclude-pattern>
<exclude-pattern>
/node_modules/
</exclude-pattern>
<exclude-pattern>
/node_modules/
</exclude-pattern>
<exclude-pattern>
/tests/*
</exclude-pattern>
<!-- How to scan -->
<!-- How to scan -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
<!-- Usage instructions: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage -->
...
@@ -18,27 +19,27 @@
...
@@ -18,27 +19,27 @@
<!-- Rules: Check PHP version compatibility -->
<!-- Rules: Check PHP version compatibility -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config
name=
"testVersion"
value=
"
5.3
-"
/>
<config
name=
"testVersion"
value=
"
7.2
-"
/>
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
<rule
ref=
"PHPCompatibilityWP"
/>
<rule
ref=
"PHPCompatibilityWP"
/>
<!-- Rules: WordPress Coding Standards -->
<!-- Rules: WordPress Coding Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config
name=
"minimum_supported_wp_version"
value=
"
4.6
"
/>
<config
name=
"minimum_supported_wp_version"
value=
"
3.2.1
"
/>
<rule
ref=
"WordPress"
>
<rule
ref=
"WordPress"
/
>
<
exclude
name
=
"WordPress
.
VIP
"
/>
<
rule
ref
=
"WordPressVIP
Minimum"
/>
<
/
rule>
<rule
ref=
"WordPress-VIP-Go"
/
>
<rule
ref=
"WordPress.NamingConventions.PrefixAllGlobals"
>
<rule
ref=
"WordPress.NamingConventions.PrefixAllGlobals"
>
<properties>
<properties>
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<!-- Value: replace the function, class, and variable prefixes used. Separate multiple prefixes with a comma. -->
<property
name=
"prefixes"
type=
"array"
value=
"
my-plugin
"
/>
<property
name=
"prefixes"
type=
"array"
value=
"
view_all_posts_pages,vapp
"
/>
</properties>
</properties>
</rule>
</rule>
<rule
ref=
"WordPress.WP.I18n"
>
<rule
ref=
"WordPress.WP.I18n"
>
<properties>
<properties>
<!-- Value: replace the text domain used. -->
<!-- Value: replace the text domain used. -->
<property
name=
"text_domain"
type=
"array"
value=
"
my-plugin
"
/>
<property
name=
"text_domain"
type=
"array"
value=
"
view_all_posts_pages
"
/>
</properties>
</properties>
</rule>
</rule>
<rule
ref=
"WordPress.WhiteSpace.ControlStructureSpacing"
>
<rule
ref=
"WordPress.WhiteSpace.ControlStructureSpacing"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment