Skip to content

Commit

Permalink
Update supported WordPress/PHP versions
Browse files Browse the repository at this point in the history
- Pin to the latest JS SDK
- Upgrade the base WordPress image to wordpress:5.9-php7.3-apache
- Update phpunit/phpunit
- Switch to MariaDB, version mariadb:10.11
- Adjust the test matrix to use the latest versions

PR #199
  • Loading branch information
rwngallego authored Dec 28, 2024
1 parent 831da0f commit 75bb604
Show file tree
Hide file tree
Showing 12 changed files with 1,009 additions and 756 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.3
tools: composer
env:
fail-fast: true
Expand Down
63 changes: 30 additions & 33 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,38 @@ jobs:
strategy:
matrix:
# See: https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/
wordpress-version: ['5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8', '5.9']
php-versions: ['7.2', '7.3', '7.4', '8.0']
exclude:
- php-versions: '8.0'
wordpress-version: '5.2'
- php-versions: '8.0'
wordpress-version: '5.3'
- php-versions: '8.0'
wordpress-version: '5.4'
- php-versions: '8.0'
wordpress-version: '5.5'
wordpress-version: ['6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7']
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
include:
# WordPress 6.0:
- wordpress-version: '6.0'
php-versions: '7.3'
- wordpress-version: '6.0'
php-versions: '7.4'
- wordpress-version: '6.0'
php-versions: '8.0'
- wordpress-version: '6.0'
php-versions: '8.1'
# php 8.3:
- php-versions: '8.3'
wordpress-version: '6.7'
- php-versions: '8.3'
wordpress-version: '6.6'
- php-versions: '8.3'
wordpress-version: '6.5'
- php-versions: '8.3'
wordpress-version: '6.4'

name: PHP:${{ matrix.php-versions }} / WP:${{ matrix.wordpress-version }}
services:
mysql:
image: mysql:5.7
mariadb:
image: mariadb:10.11
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MARIADB_ROOT_PASSWORD: password
MARIADB_DATABASE: wordpress
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
Expand All @@ -50,35 +59,23 @@ jobs:
fail-fast: true

- name: Setup Wordpress over phpunit
run: bash bin/install-wp-tests.sh wordpress root password 127.0.0.1:${{ job.services.mysql.ports[3306] }} ${{ matrix.wordpress-version }} true
run: bash bin/install-wp-tests.sh wordpress root password 127.0.0.1:${{ job.services.mariadb.ports[3306] }} ${{ matrix.wordpress-version }} true

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Only for WP 5.9 and PHP 8
# See: https://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-php-test-suite/
if: ${{ matrix.php-versions == '8.0' && matrix.wordpress-version == '5.9' }}
run: (composer remove --dev phpunit/phpunit || true ) && composer update --dev yoast/phpunit-polyfills --with-dependencies && composer install --no-progress --prefer-dist --optimize-autoloader

- name: When using PHP 8 and WP <= 5.8
# See: https://core.trac.wordpress.org/ticket/50902
if: ${{ matrix.php-versions == '8.0' && (matrix.wordpress-version == '5.6' || matrix.wordpress-version == '5.7' || matrix.wordpress-version == '5.8' )}}
run: composer install --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs

- name: Install Composer dependencies
# Rest of the versions
if: ${{ matrix.php-versions != '8.0' }}
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run the tests
Expand All @@ -97,7 +94,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
php-version: 7.3
tools: composer
env:
fail-fast: true
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/vendor/
/data
.idea
.gradle
out/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM wordpress:5.6-php7.2-apache
FROM wordpress:5.9-php7.3-apache

RUN apt-get update
RUN apt-get install -y vim subversion mariadb-client wget
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,7 @@ You can use the `Perfecty_Push_Integration` class to send Push Notifications fro

## Local development 👨🏻‍💻

To see it in action in your local development environment, you need a set of
services which Wordpress relies on. You start off by creating the docker image:

```
docker build -t custom-wordpress:5.6-php7.2-apache .
```

Then start all the services and run the setup:
To see it in action in your local development environment you can run the following commands:

```
make up
Expand Down Expand Up @@ -182,4 +175,4 @@ of each project, which in general use the MIT license, except the WordPress plug

[<img alt="Jetbrains" src="https://github.com/perfectyorg/perfecty-push-wp/raw/master/.github/assets/jetbrains-logo.svg" width="120">](https://www.jetbrains.com/?from=PerfectyPush)

Thanks to Jetbrains for supporting this Open Source project with their magnificent tools.
Thanks to Jetbrains for supporting this Open Source project with their magnificent tools.
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Perfecty Push Notifications ===
Contributors: rwngallego, mociofiletto
Donate link: https://paypal.me/tatalata777
Donate link: https://paypal.me/RowinsonG
Tags: Push Notifications, Web Push Notifications, Notifications, User engagement
Requires at least: 5.0
Tested up to: 6.0
Tested up to: 6.7
Stable tag: 1.6.2
Requires PHP: 7.2
License: GPLv2 or later
Expand Down
2 changes: 1 addition & 1 deletion admin/partials/perfecty-push-admin-about.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// translators: %1$s is the opening a tag
// translators: %2$s is the closing a tag
esc_html__( 'If you want to support the development of the project, you can %1$sdonate here%2$s.', 'perfecty-push-notifications' ),
'<a href="https://paypal.me/tatalata777" target="_blank">',
'<a href="https://paypal.me/RowinsonG" target="_blank">',
'</a>'
);
?>
Expand Down
2 changes: 1 addition & 1 deletion bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ setup() {
}

up() {
docker compose up -d
docker compose up --build -d
}

down() {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"require-dev": {
"mockery/mockery": "1.3.*",
"phpunit/phpunit": "^5.7.21 || ^6.5 || ^7.5",
"phpunit/phpunit": "^9.0",
"wp-coding-standards/wpcs": "^2.3",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpcompatibility/phpcompatibility-wp": "*",
Expand Down
Loading

0 comments on commit 75bb604

Please sign in to comment.