Skip to content

Commit 3374511

Browse files
authored
Workflows
1 parent 8d2f74d commit 3374511

4 files changed

Lines changed: 118 additions & 12 deletions

File tree

.github/ISSUE_TEMPLATE/compatibility-test-failure.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,46 @@
11
---
2-
title: PHP {{ env.PHP_VERSION }} Compatibility Test Failure
2+
title: WP {{ env.WP_VERSION }} / PHP {{ env.PHP_VERSION }} Compatibility Test Failure
33
labels: bug, compatibility, automated
44
assignees: []
55
---
66

7-
## PHP Compatibility Test Failure
7+
## WordPress & PHP Compatibility Test Failure
88

9-
The automated compatibility test for PHP {{ env.PHP_VERSION }} has failed.
9+
The automated compatibility test has failed for the following environment:
1010

1111
### Details
1212

1313
- **PHP Version:** {{ env.PHP_VERSION }}
14-
- **WordPress Version:** Latest
14+
- **WordPress Version:** {{ env.WP_VERSION }}
1515
- **Test Date:** {{ date | date('YYYY-MM-DD HH:mm:ss') }}
1616
- **Workflow Run:** [View detailed logs]({{ env.WORKFLOW_URL }})
1717

1818
### Next Steps
1919

20-
This issue has been automatically created because the EngineScript Simple Site Exporter plugin failed to load properly with PHP {{ env.PHP_VERSION }}. This could indicate compatibility issues that need to be addressed.
20+
This issue has been automatically created because the EngineScript Simple Site Exporter plugin failed compatibility testing with this specific WordPress and PHP version combination. This could indicate:
21+
22+
#### Potential Issues:
23+
1. **PHP Compatibility**: Code may use features not available in PHP {{ env.PHP_VERSION }}
24+
2. **WordPress API Changes**: WordPress {{ env.WP_VERSION }} may have deprecated or changed APIs
25+
3. **Plugin Dependencies**: Required extensions or functions may not be available
26+
4. **WordPress Plugin Check Violations**: Code may not meet standards for this version combination
2127

2228
#### Recommended Actions:
2329

24-
1. Review the workflow logs for specific error messages
25-
2. Check for PHP {{ env.PHP_VERSION }} specific syntax or function compatibility issues
26-
3. Test locally with PHP {{ env.PHP_VERSION }} to reproduce the issue
27-
4. Make necessary code updates to ensure compatibility
30+
1. **Review Logs**: Check the workflow logs for specific error messages and stack traces
31+
2. **Local Testing**: Test locally with WordPress {{ env.WP_VERSION }} and PHP {{ env.PHP_VERSION }} to reproduce the issue
32+
3. **Code Review**: Look for version-specific syntax, deprecated functions, or API changes
33+
4. **Plugin Check**: Run WordPress Plugin Check locally against this environment
34+
5. **Update Code**: Make necessary updates to ensure compatibility across supported versions
35+
36+
#### Testing Commands:
37+
```bash
38+
# Test with specific versions using Docker
39+
docker run --rm -v $(pwd):/app wordpress:{{ env.WP_VERSION }}-php{{ env.PHP_VERSION }}-apache
40+
41+
# Run plugin check locally
42+
wp plugin check Simple-Site-Exporter --format=json --require=./wp-content/plugins/plugin-check/cli.php
43+
```
2844

2945
Once fixed, please close this issue and reference it in the changelog.
3046

.github/ISSUE_TEMPLATE/plugin-check-failure.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The WordPress Plugin Check action has identified issues with the EngineScript Si
1111
### Details
1212

1313
- **Test Date:** {{ date | date('YYYY-MM-DD HH:mm:ss') }}
14+
- **PHP Version:** {{ env.PHP_VERSION }}
1415
- **Workflow Run:** [View detailed logs]({{ env.WORKFLOW_URL }})
1516

1617
### Next Steps
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: WordPress & PHP Compatibility Matrix
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
# Allow manually triggering the workflow
8+
workflow_dispatch:
9+
# Run weekly to catch new compatibility issues
10+
schedule:
11+
- cron: '0 2 * * 1' # Every Monday at 2 AM UTC
12+
13+
# Cancels all previous workflow runs for the same branch that have not yet completed
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
permissions:
19+
contents: read
20+
issues: write
21+
22+
jobs:
23+
compatibility-test:
24+
name: WP ${{ matrix.wp-version }} / PHP ${{ matrix.php-version }}
25+
runs-on: ubuntu-latest
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
31+
wp-version: ['latest']
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup PHP ${{ matrix.php-version }}
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: ${{ matrix.php-version }}
41+
extensions: mysqli, curl, zip, intl, gd, mbstring, fileinfo, xml
42+
coverage: none
43+
tools: composer:v2
44+
45+
- name: Install Composer dependencies
46+
uses: ramsey/composer-install@3.1.1
47+
with:
48+
dependency-versions: highest
49+
composer-options: "--prefer-dist --no-progress"
50+
51+
- name: WordPress Plugin Check
52+
uses: WordPress/plugin-check-action@v1.1.2
53+
with:
54+
build-dir: './'
55+
categories: |
56+
accessibility
57+
general
58+
performance
59+
plugin_repo
60+
security
61+
include-experimental: false
62+
ignore-warnings: false
63+
ignore-errors: false
64+
wp-version: ${{ matrix.wp-version }}
65+
66+
- name: Create compatibility issue on failure
67+
if: ${{ failure() }}
68+
uses: JasonEtco/create-an-issue@v2.9.2
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
RUN_ID: ${{ github.run_id }}
72+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
73+
PHP_VERSION: ${{ matrix.php-version }}
74+
WP_VERSION: ${{ matrix.wp-version }}
75+
with:
76+
filename: .github/ISSUE_TEMPLATE/compatibility-test-failure.md
77+
update_existing: false
78+
79+
- name: Mark job as failed after issue creation
80+
if: ${{ failure() }}
81+
run: |
82+
echo "::error::Compatibility test failed for WP ${{ matrix.wp-version }} / PHP ${{ matrix.php-version }}. Created issue for tracking."
83+
exit 1

.github/workflows/wordpress-plugin-check.yml renamed to .github/workflows/wp-plugin-check.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,22 @@ permissions:
1818

1919
jobs:
2020
plugin-check:
21-
name: WordPress Plugin Check
21+
name: WordPress Plugin Check (PHP ${{ matrix.php-version }})
2222
runs-on: ubuntu-latest
2323

24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
28+
2429
steps:
2530
- name: Checkout code
2631
uses: actions/checkout@v4
2732

28-
- name: Setup PHP
33+
- name: Setup PHP ${{ matrix.php-version }}
2934
uses: shivammathur/setup-php@v2
3035
with:
31-
php-version: '8.0'
36+
php-version: ${{ matrix.php-version }}
3237
extensions: mysqli, curl, zip, intl, gd, mbstring, fileinfo, xml
3338
coverage: none
3439
tools: composer:v2
@@ -70,6 +75,7 @@ jobs:
7075
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7176
RUN_ID: ${{ github.run_id }}
7277
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
78+
PHP_VERSION: ${{ matrix.php-version }}
7379
with:
7480
filename: .github/ISSUE_TEMPLATE/plugin-check-failure.md
7581
update_existing: false

0 commit comments

Comments
 (0)