Browse Source

Update depdendencies, add additional PHPUnit configuration file, improve CI pipeline

pull/284/head
SteelWagstaff 4 years ago
parent
commit
a5dec327e2
  1. 30
      .github/workflows/.pipeline.yml
  2. 3
      composer.json
  3. 2491
      composer.lock
  4. 16
      phpunit9.xml

30
.github/workflows/.pipeline.yml

@ -15,13 +15,17 @@ jobs:
matrix:
php: [ 7.3 ]
os: [ ubuntu-18.04 ]
wordpress: [ 5.8.1, latest ]
experimental: [false]
wordpress: [ 5.8.2 ]
experimental: [ false ]
include:
- php: 7.4
os: ubuntu-20.04
wordpress: latest
experimental: true
- php: 7.4
os: ubuntu-20.04
wordpress: 'trunk'
experimental: true
name: Test - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}
env:
@ -77,26 +81,34 @@ jobs:
run: npm run lint
if: matrix.experimental == false
- name: Run Frontend Tests
run: npm run test
if: matrix.experimental == false
- name: Run PHP CodeSniffer
run: composer standards
- name: Install WP tests
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wordpress }}
- name: Run Coverage
- name: Run PHP Test and PCOV
run: composer require pcov/clobber; vendor/bin/pcov clobber; vendor/bin/phpunit --configuration phpunit.xml --coverage-clover coverage.xml
if: matrix.experimental == false
- name: Run Frontend Tests
run: npm run test
- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
if: matrix.experimental == false
- name: Run PHP Tests
run: vendor/bin/phpunit
run: composer test
if: matrix.experimental == true && matrix.wordpress != 'trunk'
- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
if: matrix.experimental == false
- name: Run PHP Tests
run: |
composer remove --dev phpunit/phpunit
composer update --dev yoast/phpunit-polyfills --with-dependencies --ignore-platform-reqs
vendor/bin/phpunit --configuration phpunit9.xml
if: matrix.experimental == true && matrix.wordpress == 'trunk'
- name: Prepare Build
if: startsWith(github.ref, 'refs/tags/')

3
composer.json

@ -26,6 +26,7 @@
"require": {
"php": ">=7.3",
"composer/installers": "^1.7",
"phpunit/phpunit": "^7.5",
"pressbooks/mix": "^2.1",
"soberwp/intervention": "1.2.0-p",
"spatie/color": "^1.1"
@ -33,7 +34,7 @@
"require-dev": {
"pressbooks/coding-standards": "^1.1",
"wpreadme2markdown/wp2md": "^3.0",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0.1"
},
"scripts": {
"test": [

2491
composer.lock generated

File diff suppressed because it is too large Load Diff

16
phpunit9.xml

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" backupGlobals="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./inc</directory>
</include>
</coverage>
<php>
<const name="WP_TESTS_MULTISITE" value="1"/>
</php>
<testsuites>
<testsuite name="Pressbooks Aldine">
<directory prefix="test-" suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
Loading…
Cancel
Save