Skip to content

Commit 00591da

Browse files
authored
Merge pull request #180 from humanmade/modernize-php-matrix
2 parents 8685dbf + 7432855 commit 00591da

13 files changed

Lines changed: 634 additions & 671 deletions

.github/workflows/build.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ jobs:
1010
runs-on: ubuntu-24.04
1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414

1515
- name: Setup Node
16-
uses: actions/setup-node@v4
16+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
1717
with:
1818
node-version-file: '.nvmrc'
19+
cache: 'npm'
1920

2021
- name: Install PHP
21-
uses: shivammathur/setup-php@v2
22+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
2223
with:
23-
php-version: 7.4
24+
php-version: 8.2
2425
extensions: mysqli, xmlwriter
2526
coverage: none
2627
tools: composer:v2
@@ -32,10 +33,10 @@ jobs:
3233
3334
- name: Cache PHP Dependencies
3435
id: composer-cache
35-
uses: actions/cache@v4
36+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3637
with:
3738
path: ${{ steps.composer-cache-dir.outputs.DIR }}
38-
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}
39+
key: ${{ runner.os }}-composer-8.2-${{ hashFiles('composer.lock') }}
3940

4041
- name: Install PHP Dependencies
4142
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
@@ -49,7 +50,7 @@ jobs:
4950
5051
- name: Cache JS Dependencies
5152
id: npm-cache
52-
uses: actions/cache@v4
53+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5354
with:
5455
path: ${{ steps.npm-cache-dir.outputs.DIR }}
5556
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

.github/workflows/js-tests.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ jobs:
1414
runs-on: ubuntu-24.04
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818

1919
- name: Setup Node
20-
uses: actions/setup-node@v4
20+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
2121
with:
2222
node-version-file: '.nvmrc'
23+
cache: 'npm'
2324

2425
- name: Debugging
2526
run: |
@@ -35,7 +36,7 @@ jobs:
3536
3637
- name: Cache Dependencies
3738
id: npm-cache
38-
uses: actions/cache@v4
39+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3940
with:
4041
path: ${{ steps.npm-cache-dir.outputs.DIR }}
4142
key: ${{ runner.os }}-npm-${{ steps.npm-cache-dir.outputs.NODE_VERSION }}-${{ steps.npm-cache-dir.outputs.NPM_VERSION }}-${{ hashFiles('package-lock.json') }}

.github/workflows/php-standards.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
runs-on: ubuntu-24.04
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818

1919
- name: Install PHP
20-
uses: shivammathur/setup-php@v2
20+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
2121
with:
22-
php-version: '7.4'
22+
php-version: '8.2'
2323
coverage: none
2424

2525
- name: Debugging
@@ -35,20 +35,20 @@ jobs:
3535
3636
- name: Cache PHP Dependencies
3737
id: composer-cache
38-
uses: actions/cache@v4
38+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3939
with:
4040
path: ${{ steps.composer-cache-dir.outputs.DIR }}
41-
key: ${{ runner.os }}-composer-7.4-${{ hashFiles('composer.lock') }}
41+
key: ${{ runner.os }}-composer-8.2-${{ hashFiles('composer.lock') }}
4242

4343
- name: Install PHP Dependencies
4444
run: |
4545
composer install --prefer-dist --no-progress --no-suggest --no-interaction
4646
4747
- name: PHPCS cache
48-
uses: actions/cache@v4
48+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
4949
with:
5050
path: tests/cache
51-
key: ${{ runner.os }}-phpcs-7.4-${{ hashFiles('plugin.php') }}
51+
key: ${{ runner.os }}-phpcs-8.2-${{ hashFiles('plugin.php') }}
5252

5353
- name: Run the tests
5454
run: |

.github/workflows/test-nightly.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ jobs:
1010
strategy:
1111
matrix:
1212
php:
13-
- '7.4'
14-
- '8.0'
15-
- '8.1'
1613
- '8.2'
1714
- '8.3'
15+
- '8.4'
16+
- '8.5'
1817
fail-fast: false
1918
name: WP nightly / PHP ${{ matrix.php }}
2019
runs-on: ubuntu-24.04
2120
steps:
2221
- name: Checkout repository
23-
uses: actions/checkout@v4
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2423

2524
- name: Install PHP
26-
uses: shivammathur/setup-php@v2
25+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
2726
with:
2827
php-version: ${{ matrix.php }}
2928
extensions: mysqli, xmlwriter
@@ -44,7 +43,7 @@ jobs:
4443
4544
- name: Cache PHP Dependencies
4645
id: composer-cache
47-
uses: actions/cache@v4
46+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
4847
with:
4948
path: ${{ steps.composer-cache-dir.outputs.DIR }}
5049
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}

.github/workflows/test.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ jobs:
1313
strategy:
1414
matrix:
1515
php:
16-
- '7.4'
17-
- '8.0'
18-
- '8.1'
1916
- '8.2'
2017
- '8.3'
18+
- '8.4'
19+
- '8.5'
2120
fail-fast: false
22-
name: WP 6.6 / PHP ${{ matrix.php }}
21+
name: WP 6.9 / PHP ${{ matrix.php }}
2322
runs-on: ubuntu-24.04
2423
steps:
2524
- name: Checkout repository
26-
uses: actions/checkout@v4
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2726

2827
- name: Install PHP
29-
uses: shivammathur/setup-php@v2
28+
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
3029
with:
3130
php-version: ${{ matrix.php }}
3231
extensions: mysqli, xmlwriter
@@ -47,10 +46,10 @@ jobs:
4746
4847
- name: Cache PHP Dependencies
4948
id: composer-cache
50-
uses: actions/cache@v4
49+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5150
with:
5251
path: ${{ steps.composer-cache-dir.outputs.dir }}
53-
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}-wp6.6
52+
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }}-wp6.9
5453

5554
- name: Install PHP Dependencies
5655
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
# Files:
1010

1111
/tests/.env
12+
.phpunit.result.cache

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Authorship
22

33
Stable tag: 0.2.17
4-
Requires at least: 5.4
5-
Tested up to: 6.2
6-
Requires PHP: 7.2
4+
Requires at least: 5.4
5+
Tested up to: 6.9
6+
Requires PHP: 8.2
77
License: GPL v3 or later
88
Contributors: johnbillion, humanmade
99

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
"license": "GPL-3.0-or-later",
55
"type": "wordpress-plugin",
66
"require": {
7-
"php": ">=7.2",
7+
"php": ">=8.2",
88
"composer/installers": "^1.0 || ^2.0"
99
},
1010
"require-dev": {
1111
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
1212
"ergebnis/composer-normalize": "^2",
1313
"humanmade/coding-standards": "dev-upgrade-wpcs",
14-
"php-stubs/wordpress-stubs": "^5.5",
14+
"php-stubs/wordpress-stubs": "^6.9",
1515
"phpcompatibility/phpcompatibility-wp": "2.1.0",
16-
"phpstan/phpstan": "0.12.57",
16+
"phpstan/phpstan": "^2",
1717
"phpunit/phpunit": "^9.5.20",
18-
"roots/wordpress": "~6.6.0",
19-
"szepeviktor/phpstan-wordpress": "0.7.1",
18+
"roots/wordpress": "~6.9.0",
19+
"szepeviktor/phpstan-wordpress": "^2",
2020
"vlucas/phpdotenv": "^3",
2121
"wp-cli/db-command": "^2",
22-
"wp-phpunit/wp-phpunit": "~6.6.0",
22+
"wp-phpunit/wp-phpunit": "~6.9.0",
2323
"yoast/phpunit-polyfills": "^1.0"
2424
},
2525
"repositories": {
@@ -36,7 +36,7 @@
3636
"roots/wordpress-core-installer": true
3737
},
3838
"platform": {
39-
"php": "7.4"
39+
"php": "8.2"
4040
},
4141
"preferred-install": "dist",
4242
"sort-packages": true
@@ -58,7 +58,7 @@
5858
"phpcs -p --cache=tests/cache/phpcs ."
5959
],
6060
"test:phpstan": [
61-
"phpstan analyze"
61+
"phpstan analyze --memory-limit=1G"
6262
],
6363
"test:ut": [
6464
"wp db reset --yes --path=tests/wordpress #",

0 commit comments

Comments
 (0)