Skip to content

Commit 0f1a449

Browse files
authored
WP integration test
1 parent a8510c8 commit 0f1a449

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: WordPress Plugin Integration Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch: # Allow manual triggering
9+
10+
permissions:
11+
contents: read
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
integration-test:
17+
name: Run WordPress Integration Tests
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
php-version: ['7.4', '8.0', '8.1', '8.2']
22+
wordpress-version: ['latest', '6.3', '6.2', '6.1', '6.0', '5.9']
23+
fail-fast: false
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: WordPress Plugin Integration Test
30+
uses: holyhope/test-wordpress-plugin-github-action@v2.0.2
31+
with:
32+
php-version: ${{ matrix.php-version }}
33+
wordpress-version: ${{ matrix.wordpress-version }}
34+
plugin-name: 'simple-wp-optimizer'
35+
plugin-slug: 'simple-wp-optimizer'
36+
37+
- name: Add labels to any PRs
38+
if: github.event_name == 'pull_request'
39+
uses: actions/github-script@v6
40+
with:
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
script: |
43+
github.rest.issues.addLabels({
44+
issue_number: context.issue.number,
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
labels: ['automated', 'documentation', 'plugin update']
48+
})

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Added full plugin header information including plugin URI and License URI
1313
- Created .wordpress-version-checker.json configuration for WordPress compatibility checking
1414
- Enabled automatic PR creation for WordPress compatibility updates with "automated" and "documentation" labels
15+
- Added WordPress Plugin Integration Test workflow using holyhope/test-wordpress-plugin-github-action@v2.0.2
16+
- Implemented testing matrix for PHP versions 7.4-8.2 and WordPress versions 5.9-latest
17+
- Added plugin-slug parameter to integration test workflow
18+
- Added automated PR labeling with "automated", "documentation", and "plugin update" tags
19+
- Set up proper GitHub permissions for integration test workflow
1520

1621
## [1.5.4] - 2025-05-04
1722
### Changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,15 @@ This repository uses the [WordPress Version Checker](https://github.com/skaut/wo
103103

104104
This ensures our plugin stays up-to-date with the latest WordPress versions without manual intervention.
105105

106+
### Integration Testing
107+
108+
The plugin is automatically tested using [WordPress Plugin Integration Test](https://github.com/marketplace/actions/wordpress-plugin-integration-test) GitHub Action. Our test matrix includes:
109+
110+
- PHP versions: 7.4, 8.0, 8.1, 8.2
111+
- WordPress versions: latest, 6.3, 6.2, 6.1, 6.0, 5.9
112+
113+
This ensures compatibility across a wide range of environment configurations and helps catch issues early in the development process.
114+
106115
## Contributing
107116

108117
Contributions are welcome! Please feel free to submit a Pull Request.

0 commit comments

Comments
 (0)