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

Release 0.7.0 #168

Merged
merged 13 commits into from
Sep 9, 2023
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
52 changes: 0 additions & 52 deletions .github/workflows/changelog.js

This file was deleted.

15 changes: 4 additions & 11 deletions .github/workflows/cs-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:

strategy:
matrix:
php: ['7.1', '8.1']
php: ['7.4', '8.2']
experimental: [false]
include:
- php: '8.2'
- php: '8.3'
experimental: true
fail-fast: false

Expand All @@ -49,28 +49,21 @@ jobs:
uses: korelstar/xmllint-problem-matcher@v1

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
if: ${{ matrix.php < 8.2 }}
uses: ramsey/composer-install@v2

- name: Install Composer dependencies for PHP >= 8.2
if: ${{ matrix.php >= 8.2 }}
uses: ramsey/composer-install@v2
with:
composer-options: --ignore-platform-reqs

# Lint PHP.
- name: Lint PHP against parse errors
run: composer lint-ci --no-interaction | cs2pr

# Needed as runs-on: system doesn't have xml-lint by default.
# @link https://github.com/marketplace/actions/xml-lint
- name: Lint phpunit.xml.dist
if: ${{ matrix.php >= 7.3 }}
if: ${{ matrix.php >= 8.0 }}
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: ./phpunit.xml.dist
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ on:

# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
tag:
name: New tag
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Dependencies
run: npm install

- name: Populate Changelog
run: node .github/workflows/changelog.js
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
Expand Down
77 changes: 47 additions & 30 deletions .github/workflows/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,58 @@ on:
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: WP ${{ matrix.wordpress }} on PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

env:
WP_VERSION: ${{ matrix.wordpress }}

strategy:
# PHP 7.1 uses PHPUnit 7.5.20
# PHP 7.2 uses PHPUnit 8.5.21
# PHP 7.3 uses PHPUnit 9.5.10
# PHP 7.4 uses PHPUnit 9.5.10
# PHP 8.0 uses PHPUnit 9.5.10
# PHP 8.1 uses PHPUnit 9.5.10
# PHP 8.2 uses PHPUnit 9.5.10
# Key:
# - coverage: Whether to run the tests with code coverage.
# - experimental: Whether the build is "allowed to fail".
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
wordpress: ['5.5', '5.6', '5.7', '5.8', '5.9']
experimental: [false]
coverage: [none]
php: [ '7.4', '8.2' ]
wordpress: [ '5.7', '6.3' ]
allowed_failure: [false]
coverage: [false]
include:
- php: '7.1'
wordpress: '5.8.3'
experimental: false
coverage: none
# Check upcoming WP.
- php: '8.2'
wordpress: 'trunk'
allowed_failure: true
coverage: false
# Check upcoming PHP.
- php: '8.3'
wordpress: 'latest'
allowed_failure: true
coverage: false
# Code coverage on latest PHP and WP.
- php: '8.2'
wordpress: 'latest'
allowed_failure: false
coverage: true
exclude:
# WordPress 5.7 doesn't support PHP 8.2.
- php: '8.2'
wordpress: '5.7'
fail-fast: false
continue-on-error: ${{ matrix.experimental }}
continue-on-error: ${{ matrix.allowed_failure }}

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
coverage: ${{ matrix.coverage }}
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}

- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
Expand All @@ -60,14 +71,7 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install Composer dependencies
if: ${{ matrix.php < 8.2 }}
uses: ramsey/composer-install@v2

- name: Install Composer dependencies for PHP >= 8.2
if: ${{ matrix.php >= 8.2 }}
uses: ramsey/composer-install@v2
with:
composer-options: --ignore-platform-reqs

- name: Start MySQL Service
run: sudo systemctl start mysql.service
Expand All @@ -80,4 +84,17 @@ jobs:
run: composer prepare-ci --no-interaction

- name: Run integration tests
if: ${{ matrix.coverage == false }}
run: composer test --no-interaction

- name: Run integration tests with code coverage
if: ${{ matrix.coverage == true }}
run: composer coverage-ci --no-interaction

- name: Send coverage report to Codecov
if: ${{ success() && matrix.coverage == true }}
uses: codecov/codecov-action@v3
with:
files: ./clover.xml
fail_ci_if_error: true
verbose: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.phpunit.result.cache
/.phpunit.cache
/clover.xml
/composer.lock
/package-lock.json
/vendor
4 changes: 2 additions & 2 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<rule ref="PHPCompatibilityWP"/>
<!-- For help in understanding this testVersion:
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
<config name="testVersion" value="7.1-"/>
<config name="testVersion" value="7.4-"/>

<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
Expand All @@ -39,7 +39,7 @@
<rule ref="WordPress-Docs"/>
<!-- For help in understanding these custom sniff properties:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties -->
<config name="minimum_supported_wp_version" value="5.5"/>
<config name="minimum_supported_wp_version" value="5.7"/>

<!-- Rules: WordPress VIP - see
https://github.com/Automattic/VIP-Coding-Standards -->
Expand Down
Loading