Skip to content

Commit

Permalink
Separate CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Jul 21, 2020
1 parent 7d21d0f commit 4268379
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,2 +1,2 @@

vendor/*
/vendor/
/phpcs.xml
96 changes: 56 additions & 40 deletions .travis.yml
@@ -1,56 +1,72 @@
language: php
dist: trusty

notifications:
email:
on_success: never
on_failure: change
os:
- linux

branches:
only:
- master
dist: bionic

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.4
- 7.3
- 7.2
- 7.1
- nightly

env:
- WP_VERSION=latest WP_MULTISITE=0
- WP_VERSION=latest WP_MULTISITE=1
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.6"
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.6"

services:
- mysql

matrix:
jobs:
include:
- php: 7.0
dist: xenial
env:
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="^5.6"
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="^5.6"
- php: 5.6
dist: xenial
env:
- WP_VERSION=latest WP_MULTISITE=0 PHPUNIT_VERSION="4.8.*"
- WP_VERSION=latest WP_MULTISITE=1 PHPUNIT_VERSION="4.8.*"
- name: "Coding Standars"
php: 7.4
install:
- composer require --dev wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
script:
- vendor/bin/phpcs
- name: "Static Analysis"
php: 7.4
install:
- composer require --dev szepeviktor/phpstan-wordpress
script:
- vendor/bin/phpstan analyze
allow_failures:
- php: nightly

before_script:
- bash bin/install-wp-tests.sh wordpress_test root "" localhost $WP_VERSION
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- |
if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]]; then
composer global require "phpunit/phpunit=^5.6"
else
composer global require "phpunit/phpunit=4.8.*"
fi
- |
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
- |
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
composer require "szepeviktor/phpstan-wordpress:^0.5.0"
fi
script:
- phpcs --standard=phpcs.ruleset.xml $(find -name "*.php")
- |
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
vendor/bin/phpstan analyze
fi
- phpunit
branches:
only:
- master

cache:
directories:
- $HOME/.composer/cache
- "${HOME}/.composer/cache"

before_install:
- composer remove --dev stevegrunwell/wp-enforcer
# Shim Composer's post-install-cmd script
- install -T /dev/null vendor/bin/wp-enforcer

install:
- bin/install-wp-tests.sh wordpress_test root "" localhost "${WP_VERSION}"
- composer global require --dev "phpunit/phpunit=${PHPUNIT_VERSION}"

script:
- "${HOME}/.composer/vendor/bin/phpunit"

notifications:
email:
on_success: never
on_failure: change
85 changes: 55 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions phpcs.ruleset.xml

This file was deleted.

11 changes: 0 additions & 11 deletions phpcs.xml

This file was deleted.

10 changes: 10 additions & 0 deletions phpcs.xml.dist
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>

<rule ref="WordPress-Core"/>
<rule ref="WordPress-Docs"/>

<file>./class-wp-bootstrap-navwalker.php</file>
<file>./tests/</file>
</ruleset>

0 comments on commit 4268379

Please sign in to comment.