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

3
composer.json

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