Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI config #1

Merged
merged 5 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,34 @@ language: php
os:
- linux
dist: bionic

addons:
apt:
packages:
- subversion

services:
- mysql

php:
# TODO PHP 8.0
- '7.4'
# TODO
#- '8.0'

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

# TODO maybe test building docs at some point

addons:
apt:
packages:
- subversion

before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
- mysql -e 'GRANT ALL PRIVILEGES ON test.* TO test@localhost IDENTIFIED BY "test";'
- composer self-update --1

install:
- composer install --no-interaction --prefer-dist
- DB_HOST=127.0.0.1 DB_NAME=test DB_USER=test DB_PASS=test bin/install-wp-tests.sh

script:
- vendor/bin/phpunit
- ./vendor/bin/phpcs --standard=./phpcs.xml test/unit test/integration src
- vendor/bin/phpstan analyse
- composer run-script test
- composer run-script sniff
- composer run-script phpstan
18 changes: 7 additions & 11 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@

<arg name="tab-width" value="2" />

<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />

<!--
Default settings for command line usage
-->

<!-- Exclude folders and files from being checked. -->
<!-- What files to check. -->
<file>./greg.php</file>
<file>./src/</file>
<file>./test/unit/</file>
<file>./test/integration/</file>
<exclude-pattern>wp-content/</exclude-pattern>
<exclude-pattern>wp/</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>test/themes</exclude-pattern>

<!-- If no files or directories are specified on the command line, check all relevant files. -->
<file>./lib</file>
<exclude-pattern>vendor/</exclude-pattern>

<!-- Use colors in output. -->
<arg name="colors"/>
Expand Down