Skip to content

Commit f0496bf

Browse files
committed
Merge remote-tracking branch 'origin/trunk' into add/ci-workflow-for-unit-tests
2 parents 217dcae + 0a774ff commit f0496bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4768
-987
lines changed

.codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ coverage:
2424
target: 70%
2525
threshold: 5%
2626
if_ci_failed: ignore
27+
only_pulls: true
2728

2829
ignore:
2930
- '*.min.css'

.github/workflows/e2e.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,52 @@ name: E2E Tests
33
on:
44
pull_request:
55
branches: [trunk]
6+
push:
7+
branches: [trunk]
8+
# Allow manually triggering the workflow
9+
workflow_dispatch:
10+
11+
# Cancels all previous workflow runs for pull requests that have not completed
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
14+
cancel-in-progress: true
15+
16+
# Disable permissions for all available scopes by default
17+
permissions: {}
618

719
jobs:
820
test:
9-
name: Playwright e2e Tests
21+
name: Node ${{ matrix.node }} / WP ${{ matrix.wp }}
1022
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
event: ['${{ github.event_name }}']
30+
node: ['22', '24']
31+
wp: ['6.2', 'latest', 'trunk']
32+
exclude:
33+
# On PRs: only test Node 22 + WP trunk for fast feedback
34+
# On trunk: full matrix with minimum and latest WP versions
35+
- event: 'pull_request'
36+
node: '24'
37+
- event: 'pull_request'
38+
wp: '6.2'
39+
- event: 'pull_request'
40+
wp: 'trunk'
41+
42+
env:
43+
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || (matrix.wp != 'latest' && format('WordPress/WordPress#{0}', matrix.wp) || null) }}
44+
1145
steps:
1246
- uses: actions/checkout@v4
1347

1448
- name: Setup Node.js
1549
uses: actions/setup-node@v4
1650
with:
17-
node-version-file: '.nvmrc'
51+
node-version: ${{ matrix.node }}
1852
cache: 'npm'
1953

2054
- name: Install dependencies

.github/workflows/phpunit.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
strategy:
19-
matrix:
20-
include:
21-
# Minimum supported PHP
22-
- php: '7.4'
23-
# Latest stable PHP
24-
- php: '8.4'
2519
fail-fast: false
20+
matrix:
21+
event: ['${{ github.event_name }}']
22+
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
23+
exclude:
24+
# On PRs: only test minimum and latest PHP versions
25+
- event: 'pull_request'
26+
php: '8.0'
27+
- event: 'pull_request'
28+
php: '8.1'
29+
- event: 'pull_request'
30+
php: '8.2'
31+
- event: 'pull_request'
32+
php: '8.3'
2633

2734
steps:
2835
- name: Checkout code

.phpcs.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
<!-- Refactoring of this scale is not in scope yet.-->
2525
<exclude name="WordPress.Files.FileName" />
2626
<!-- Exclude the entire filename rule -->
27+
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents" />
28+
<!-- file_get_contents is safe for reading local plugin files bundled with the plugin. -->
2729
</rule>
2830

2931
<rule ref="WordPress.Security.EscapeOutput">

assets/src/js/_acf-validation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,11 @@
11621162
'editor-post-publish-panel'
11631163
)[ 0 ];
11641164
if ( publishPanel ) {
1165+
// See https://github.com/WordPress/secure-custom-fields/pull/272
1166+
// `togglePublishSidebar` was only introduced in WP 6.6, it should be optional
11651167
wp.data
11661168
.dispatch( 'core/editor' )
1167-
.togglePublishSidebar();
1169+
.togglePublishSidebar?.();
11681170
}
11691171

11701172
// Add block to errors array

docs/bin/manifest.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
"parent": null,
3030
"markdown_source": "https://github.com/wordpress/secure-custom-fields/blob/trunk/docs/welcome/index.md"
3131
},
32-
"code-reference/abilities": {
33-
"slug": "abilities",
34-
"parent": "code-reference",
35-
"markdown_source": "https://github.com/wordpress/secure-custom-fields/blob/trunk/docs/code-reference/abilities/index.md"
36-
},
3732
"code-reference/acf-bidirectional-functions-file": {
3833
"slug": "acf-bidirectional-functions-file",
3934
"parent": "code-reference",
@@ -284,11 +279,6 @@
284279
"parent": "welcome",
285280
"markdown_source": "https://github.com/wordpress/secure-custom-fields/blob/trunk/docs/welcome/quick-start.md"
286281
},
287-
"code-reference/abilities/class-scf-post-type-abilities-file": {
288-
"slug": "class-scf-post-type-abilities-file",
289-
"parent": "abilities",
290-
"markdown_source": "https://github.com/wordpress/secure-custom-fields/blob/trunk/docs/code-reference/abilities/class-scf-post-type-abilities-file.md"
291-
},
292282
"code-reference/admin/admin-commands-file": {
293283
"slug": "admin-commands-file",
294284
"parent": "admin",

docs/code-reference/abilities/class-scf-post-type-abilities-file.md

Lines changed: 0 additions & 182 deletions
This file was deleted.

docs/code-reference/abilities/index.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

includes/abilities/abilities-integration.php renamed to includes/abilities/class-scf-abilities-integration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Handles integration with WordPress Abilities API.
1717
*
1818
* @since 6.6.0
19+
* @codeCoverageIgnore Glue code tested implicitly via E2E tests.
1920
*/
2021
class SCF_Abilities_Integration {
2122

@@ -38,7 +39,9 @@ public function init() {
3839
return;
3940
}
4041

42+
acf_include( 'includes/abilities/class-scf-internal-post-type-abilities.php' );
4143
acf_include( 'includes/abilities/class-scf-post-type-abilities.php' );
44+
acf_include( 'includes/abilities/class-scf-taxonomy-abilities.php' );
4245
}
4346

4447
/**

0 commit comments

Comments
 (0)