Skip to content

Commit 53b7ca1

Browse files
authored
Merge branch 'trunk' into dev/string-name-registration
2 parents 9c361b9 + f36c71f commit 53b7ca1

24 files changed

Lines changed: 1326 additions & 325 deletions

.github/workflows/copilot-setup-steps.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ jobs:
3838
with:
3939
php-version: '8.3'
4040
coverage: none
41-
42-
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
43-
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
4441
- name: Install Composer dependencies
4542
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
46-
with:
47-
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
4843

4944
- name: Setup Node
5045
uses: actions/setup-node@v4

.github/workflows/release.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Upload Package on Release
2+
3+
# Cancels all previous workflow runs for pull requests that have not completed.
4+
concurrency:
5+
# The concurrency group contains the workflow name and the branch name for pull requests
6+
# or the commit hash for any other events.
7+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
8+
cancel-in-progress: true
9+
10+
on:
11+
release:
12+
types: [published]
13+
14+
jobs:
15+
tag:
16+
name: Upload New Release
17+
runs-on: ubuntu-24.04
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
24+
persist-credentials: false
25+
26+
- name: Set up PHP
27+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
28+
with:
29+
php-version: '8.3'
30+
coverage: none
31+
tools: composer:v2
32+
33+
- name: Install Composer dependencies
34+
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
35+
36+
- name: Setup Node
37+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
38+
with:
39+
cache: 'npm'
40+
node-version-file: '.nvmrc'
41+
42+
- name: Install NPM dependencies
43+
run: npm ci
44+
env:
45+
CI: true
46+
47+
- name: Create Artifact
48+
run: |
49+
npm run plugin-zip
50+
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
53+
with:
54+
name: abilities-api
55+
path: abilities-api.zip
56+
57+
- name: Upload release asset
58+
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
59+
with:
60+
files: abilities-api.zip
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 20 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
# - Sets up PHP.
2929
# - Configures caching for PHPCS scans.
3030
# - Installs Composer dependencies.
31-
# - Make Composer packages available globally.
3231
# - Runs PHPCS on the full codebase.
3332
# - Generate a report for displaying issues as pull request annotations.
3433
phpcs:
@@ -68,11 +67,6 @@ jobs:
6867
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
6968
- name: Install Composer dependencies
7069
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
71-
with:
72-
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
73-
74-
- name: Make Composer packages available globally
75-
run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH"
7670

7771
- name: Run PHPCS
7872
id: phpcs
@@ -89,12 +83,11 @@ jobs:
8983
# Performs the following steps:
9084
# - Checks out the repository.
9185
# - Sets up PHP.
92-
# - Installs Composer dependencies.
9386
# - Configures caching for PHP static analysis scans.
94-
# - Make Composer packages available globally.
87+
# - Installs Composer dependencies.
88+
# - Makes Composer packages available globally.
9589
# - Runs PHPStan static analysis (with Pull Request annotations).
9690
# - Saves the PHPStan result cache.
97-
# - Ensures version-controlled files are not modified or deleted.
9891
phpstan:
9992
name: Run PHP static analysis
10093
runs-on: ubuntu-24.04
@@ -116,30 +109,26 @@ jobs:
116109
coverage: none
117110
tools: cs2pr
118111

119-
# This date is used to ensure that the Composer cache is cleared at least once every week.
112+
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
120113
# http://man7.org/linux/man-pages/man1/date.1.html
121114
- name: "Get last Monday's date"
122115
id: get-date
123116
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
124117

125-
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
126-
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
127-
- name: Install Composer dependencies
128-
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
129-
with:
130-
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
131-
132-
- name: Make Composer packages available globally
133-
run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH"
134-
135118
- name: Cache PHP Static Analysis scan cache
136119
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
137120
with:
138121
path: tests/_output # This is defined in the base.neon file.
139-
key: 'phpstan-result-cache-${{ github.run_id }}'
122+
key: 'phpstan-result-cache-${{ runner.os }}-date-${{ steps.get-date.outputs.date }}'
140123
restore-keys: |
141124
phpstan-result-cache-
142125
126+
- name: Install Composer dependencies
127+
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
128+
129+
- name: Make Composer packages available globally
130+
run: echo "${PWD}/vendor/bin" >> "$GITHUB_PATH"
131+
143132
- name: Run PHP static analysis tests
144133
id: phpstan
145134
run: phpstan analyse -vvv --error-format=checkstyle | cs2pr
@@ -149,36 +138,30 @@ jobs:
149138
if: ${{ !cancelled() }}
150139
with:
151140
path: tests/_output
152-
key: 'phpstan-result-cache-${{ github.run_id }}'
141+
key: 'phpstan-result-cache-${{ runner.os }}-date-${{ steps.get-date.outputs.date }}'
153142

154143
# Runs the PHPUnit tests for WordPress.
155144
#
156145
# Performs the following steps:
157146
# - Sets environment variables.
158147
# - Checks out the repository.
159-
# - Sets up Node.js.
160148
# - Sets up PHP.
161149
# - Installs Composer dependencies.
162-
# - Installs npm dependencies
163-
# - Logs general debug information about the runner.
164-
# - Logs Docker debug information (about the Docker installation within the runner).
165-
# - Starts the WordPress Docker container.
166-
# - Logs the running Docker containers.
167-
# - Logs debug information about what's installed within the WordPress Docker containers.
168-
# - Install WordPress within the Docker container.
169-
# - Run the PHPUnit tests.
170-
# - Upload the code coverage report to Codecov.io.
171-
# - Upload the HTML code coverage report as an artifact.
172-
# - Ensures version-controlled files are not modified or deleted.
173-
# - Checks out the WordPress Test reporter repository.
174-
# - Submit the test results to the WordPress.org host test results.
150+
# - Sets up Node.js.
151+
# - Installs npm dependencies.
152+
# - Starts the WordPress Docker testing environment (with or without Xdebug coverage).
153+
# - Logs PHP and WordPress versions from the container.
154+
# - Runs PHPUnit tests (with coverage if enabled).
155+
# - Uploads code coverage report to Codecov.io (if coverage is enabled).
156+
# - Uploads HTML coverage report as an artifact (if coverage is enabled).
175157
phpunit:
176158
name: Test PHP ${{ matrix.php }} WP ${{ matrix.wp }}${{ matrix.coverage && ' with coverage' || '' }}
177159
runs-on: ubuntu-24.04
178160
strategy:
161+
fail-fast: false
179162
matrix:
180163
php: ['8.4', '8.3', '8.2', '8.1', '8.0', '7.4']
181-
wp: [latest, trunk, '6.7']
164+
wp: [latest, trunk]
182165
coverage: [false]
183166
include:
184167
- php: '8.4'
@@ -213,12 +196,8 @@ jobs:
213196
php-version: '${{ matrix.php }}'
214197
coverage: none
215198

216-
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
217-
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
218199
- name: Install Composer dependencies
219200
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
220-
with:
221-
custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")
222201

223202
- name: Setup Node
224203
uses: actions/setup-node@v4
@@ -247,7 +226,6 @@ jobs:
247226
npm run wp-env -- run cli wp core version
248227
249228
- name: Run PHPUnit tests${{ matrix.coverage && ' with coverage report' || '' }}
250-
continue-on-error: true
251229
id: phpunit
252230
run: |
253231
npm run test:php

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ Thumbs.db
3636

3737
# Tests & Coverage
3838
/coverage/
39+
40+
# Build
41+
abilities-api.zip

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Join the `#core-ai` channel [on WordPress Slack](http://wordpress.slack.com) ([s
1010

1111
## Coding standards
1212

13-
In general, all code must follow the [WordPress Coding Standards and best practices](https://developer.wordpress.org/coding-standards/). All code in the Performance Lab plugin must follow these requirements:
13+
In general, all code must follow the [WordPress Coding Standards and best practices](https://developer.wordpress.org/coding-standards/). All code in the Abilities API plugin must follow these requirements:
1414

15-
- **WordPress**: As of Performance Lab v0.0.1, released {@todo}, the plugin's minimum WordPress version requirement is 6.7.
16-
- **PHP**: The minimum required version right now is 7.4. This is subject to change and will be brought in sync with the WordPress core minimum PHP version requirement closer to release.
15+
- **WordPress**: The plugin's minimum WordPress version requirement is 6.8.
16+
- **PHP**: The minimum required version of the code slated for WordPress Core includes is PHP7.2, but the tooling and development environment requires PHP 7.4 or higher.
1717

1818
We include [several tools](#useful-commands) to help ensure your code meets contribution
1919

0 commit comments

Comments
 (0)