Browse Source

chore: Update ci pipeline, remove PHPUnit as dev dependency, use PHPUnit 9.5 by default (#311)

pull/312/head
Steel Wagstaff 3 years ago committed by GitHub
parent
commit
19ece32c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      .github/workflows/.pipeline.yml
  2. 1
      composer.json
  3. 812
      composer.lock
  4. 19
      phpunit.xml
  5. 16
      phpunit9.xml

19
.github/workflows/.pipeline.yml

@ -14,18 +14,14 @@ jobs:
fail-fast: false
matrix:
php: [ 7.3 ]
os: [ ubuntu-18.04 ]
wordpress: [ 5.8.2 ]
os: [ ubuntu-20.04 ]
wordpress: [ 5.9 ]
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:
@ -89,7 +85,7 @@ jobs:
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wordpress }}
- 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
run: composer test-coverage
if: matrix.experimental == false
- name: Upload Coverage to Codecov
@ -98,14 +94,7 @@ jobs:
- name: Run PHP Tests
run: composer test
if: matrix.experimental == true && matrix.wordpress != 'trunk'
- name: Run PHP Tests with PHPUnit 9
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'
if: matrix.experimental == true
- name: Prepare Build
if: startsWith(github.ref, 'refs/tags/')

1
composer.json

@ -31,7 +31,6 @@
"spatie/color": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"pressbooks/coding-standards": "^1.1",
"wpreadme2markdown/wp2md": "^3.0",
"yoast/phpunit-polyfills": "^1.0.1"

812
composer.lock generated

File diff suppressed because it is too large Load Diff

19
phpunit.xml

@ -1,12 +1,10 @@
<?xml version="1.0"?>
<phpunit
bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<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>
@ -15,9 +13,4 @@
<directory prefix="test-" suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./inc</directory>
</whitelist>
</filter>
</phpunit>

16
phpunit9.xml

@ -1,16 +0,0 @@
<?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