Skip to content

Commit 9b6cd7c

Browse files
authored
Merge pull request #482 from szepeviktor/fix/ci
Separate CI jobs
2 parents 7d21d0f + 4268379 commit 9b6cd7c

6 files changed

Lines changed: 123 additions & 94 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2-
vendor/*
1+
/vendor/
2+
/phpcs.xml

.travis.yml

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,72 @@
11
language: php
2-
dist: trusty
32

4-
notifications:
5-
email:
6-
on_success: never
7-
on_failure: change
3+
os:
4+
- linux
85

9-
branches:
10-
only:
11-
- master
6+
dist: bionic
127

138
php:
14-
- 5.6
15-
- 7.0
16-
- 7.1
17-
- 7.2
9+
- 7.4
1810
- 7.3
11+
- 7.2
12+
- 7.1
1913
- nightly
2014

2115
env:
22-
- WP_VERSION=latest WP_MULTISITE=0
23-
- WP_VERSION=latest WP_MULTISITE=1
16+
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.6"
17+
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.6"
18+
19+
services:
20+
- mysql
2421

25-
matrix:
22+
jobs:
23+
include:
24+
- php: 7.0
25+
dist: xenial
26+
env:
27+
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.6"
28+
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.6"
29+
- php: 5.6
30+
dist: xenial
31+
env:
32+
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="4.8.*"
33+
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="4.8.*"
34+
- name: "Coding Standars"
35+
php: 7.4
36+
install:
37+
- composer require --dev wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
38+
script:
39+
- vendor/bin/phpcs
40+
- name: "Static Analysis"
41+
php: 7.4
42+
install:
43+
- composer require --dev szepeviktor/phpstan-wordpress
44+
script:
45+
- vendor/bin/phpstan analyze
2646
allow_failures:
2747
- php: nightly
2848

29-
before_script:
30-
- bash bin/install-wp-tests.sh wordpress_test root "" localhost $WP_VERSION
31-
- export PATH="$HOME/.composer/vendor/bin:$PATH"
32-
- |
33-
if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]]; then
34-
composer global require "phpunit/phpunit=^5.6"
35-
else
36-
composer global require "phpunit/phpunit=4.8.*"
37-
fi
38-
- |
39-
composer global require wp-coding-standards/wpcs
40-
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
41-
- |
42-
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
43-
composer require "szepeviktor/phpstan-wordpress:^0.5.0"
44-
fi
45-
46-
script:
47-
- phpcs --standard=phpcs.ruleset.xml $(find -name "*.php")
48-
- |
49-
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
50-
vendor/bin/phpstan analyze
51-
fi
52-
- phpunit
49+
branches:
50+
only:
51+
- master
5352

5453
cache:
5554
directories:
56-
- $HOME/.composer/cache
55+
- "${HOME}/.composer/cache"
56+
57+
before_install:
58+
- composer remove --dev stevegrunwell/wp-enforcer
59+
# Shim Composer's post-install-cmd script
60+
- install -T /dev/null vendor/bin/wp-enforcer
61+
62+
install:
63+
- bin/install-wp-tests.sh wordpress_test root "" localhost "${WP_VERSION}"
64+
- composer global require --dev "phpunit/phpunit=${PHPUNIT_VERSION}"
65+
66+
script:
67+
- "${HOME}/.composer/vendor/bin/phpunit"
68+
69+
notifications:
70+
email:
71+
on_success: never
72+
on_failure: change

composer.lock

Lines changed: 55 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.ruleset.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

phpcs.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

phpcs.xml.dist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="WordPress Coding Standards for Plugins">
3+
<description>Generally-applicable sniffs for WordPress plugins</description>
4+
5+
<rule ref="WordPress-Core"/>
6+
<rule ref="WordPress-Docs"/>
7+
8+
<file>./class-wp-bootstrap-navwalker.php</file>
9+
<file>./tests/</file>
10+
</ruleset>

0 commit comments

Comments
 (0)