Skip to content
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
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
service_name: travis-ci
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.github/ export-ignore
/phpcs.xml.dist export-ignore
/phpdoc.xml.dist export-ignore
/phpunit.xml.dist export-ignore
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CS

on:
# Run on all pushes and on all pull requests.
# Prevent the build from running when there are only irrelevant changes.
push:
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'

jobs:
checkcs:
name: 'Basic CS and QA checks'
runs-on: ubuntu-latest

env:
XMLLINT_INDENT: ' '
# - COMPOSER_ROOT_VERSION is needed to get round the recursive dependency when using CI.
COMPOSER_ROOT_VERSION: '1.99.99'

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: 'Composer: adjust dependencies'
run: |
# The sniff stage doesn't run the unit tests, so no need for PHPUnit.
composer remove --no-update --dev phpunit/phpunit --no-scripts
# Using PHPCS `master` as an early detection system for bugs upstream.
composer require --no-update squizlabs/php_codesniffer:"dev-master"
# Add PHPCSDevCS - this is the CS ruleset we use.
# This is not in the composer.json as it has different minimum PHPCS reqs and would conflict.
composer require --no-update --dev phpcsstandards/phpcsdevcs:"^1.1.2"

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: Install xmllint
run: sudo apt-get install --no-install-recommends -y libxml2-utils

# Show XML violations inline in the file diff.
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
- uses: korelstar/xmllint-problem-matcher@v1

# Validate the XML file.
# @link http://xmlsoft.org/xmllint.html
- name: Validate rulesets against schema
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml

# Check the code-style consistency of the XML file.
- name: Check XML code style
run: |
diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml")

# Check the code-style consistency of the PHP files.
- name: Check PHP code style
run: vendor/bin/phpcs

# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
- name: Validate Composer installation
run: composer validate --no-check-all --strict
33 changes: 33 additions & 0 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Docs

on:
push:
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'

jobs:
#### TEST DOCUMENTATION SITE GENERATION ####
test:
runs-on: ubuntu-latest

name: "Test build GHPages site"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
# Use the version as per https://pages.github.com/versions/
ruby-version: 2.7.1
bundler-cache: true
working-directory: docs

- name: Test building the GH Pages site
run: |
cd docs
bundle exec jekyll build
69 changes: 69 additions & 0 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Quicktest

on:
# Run on pushes, including merges, to all branches except `master`.
push:
branches-ignore:
- master
paths-ignore:
- '**.md'
- 'docs/**'

jobs:
#### QUICK TEST STAGE ####
# This is a much quicker test which only runs the unit tests and linting against the low/high
# supported PHP/PHPCS combinations.
# These are basically the same builds as in the Test->Coverage workflow, but then without doing
# the code-coverage.
quicktest:
runs-on: ubuntu-latest

strategy:
matrix:
php: ['5.4', 'latest']
phpcs_version: ['dev-master']

include:
- php: '7.3'
phpcs_version: '2.9.2'
- php: '5.4'
phpcs_version: '2.6.0'

name: "QTest${{ matrix.phpcs_version == 'dev-master' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"

steps:
- name: Checkout code
uses: actions/checkout@v2

# On stable PHPCS versions, allow for PHP deprecation notices.
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
- name: Setup ini config
id: set_ini
run: |
if [ "${{ matrix.phpcs_version }}" != "dev-master" ]; then
echo '::set-output name=PHP_INI::error_reporting=E_ALL & ~E_DEPRECATED'
else
echo '::set-output name=PHP_INI::error_reporting=E_ALL'
fi

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
coverage: none

- name: 'Composer: set PHPCS version for tests'
run: composer require --no-update squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}"

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: Lint against parse errors
if: matrix.phpcs_version == 'dev-master'
run: composer lint

- name: Run the unit tests
run: vendor/bin/phpunit --no-coverage
Loading