Skip to content

Commit 6d4d57e

Browse files
carterbucefacebook-github-bot
authored andcommitted
Always run PHP-based github workflows (#2926)
Summary: In PRs that don't modify any php files, the "Code sniff" and "PHP Unit Tests" checks get stuck in a pending state (ex. #2918). They do not run because the PR doesn't match any of the filters that the workflows define. This causes issues because our repository is set up to require all checks to pass before merging. This PR updates the filtering on these workflows to run on every PR, regardless of what files were changed. Pull Request resolved: #2926 Reviewed By: nrostrow-meta Differential Revision: D70673188 Pulled By: carterbuce fbshipit-source-id: e2fc616d497e21b9b4f993da365afcc4a0664b4f
1 parent 77e34ab commit 6d4d57e

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

.github/workflows/php-cs-on-changes.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
name: PHP Coding Standards - PR Changed Files
22

33
on:
4-
pull_request:
5-
paths:
6-
- "**.php"
7-
- .github/workflows/php-cs-on-changes.yml
4+
pull_request: { }
5+
# run on all PRs
86

97
concurrency:
108
group: ${{ github.workflow }}-${{ github.ref }}
@@ -16,7 +14,7 @@ jobs:
1614
timeout-minutes: 15
1715
strategy:
1816
matrix:
19-
php: [7.4, 8.3]
17+
php: [ 7.4, 8.3 ]
2018
name: Code sniff (PHP ${{ matrix.php }}, WP Latest)
2119
permissions:
2220
contents: read
@@ -45,3 +43,7 @@ jobs:
4543
- name: Run PHPCS
4644
if: steps.changed-files.outputs.any_changed == 'true'
4745
run: vendor/bin/phpcs-changed --warning-severity=0 -s --git --git-base ${{ github.event.pull_request.base.sha }} ${{ steps.changed-files.outputs.all_changed_files }}
46+
47+
- name: Skip PHPCS - No PHP Files Updated
48+
if: steps.changed-files.outputs.any_changed != 'true'
49+
run: echo "No PHP files changed; skipping PHPCS checks."

.github/workflows/php-unit-tests.yml

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
11
name: PHP Unit Tests
22

3-
on:
4-
push:
5-
branches:
6-
- trunk
7-
- develop
8-
paths:
9-
- "**.php"
10-
- composer.json
11-
- composer.lock
12-
- .github/workflows/php-unit-tests.yml
13-
pull_request:
14-
paths:
15-
- "**.php"
16-
- composer.json
17-
- composer.lock
18-
- .github/workflows/php-unit-tests.yml
3+
on: [ push, pull_request ] # Run on all pushes and PRs
194

205
concurrency:
216
group: ${{ github.workflow }}-${{ github.ref }}
@@ -30,9 +15,9 @@ jobs:
3015
WP_TESTS_DIR: "/tmp/wordpress/tests/phpunit"
3116
strategy:
3217
matrix:
33-
php: [7.4, 8.3]
34-
wp-version: [latest]
35-
wc-version: [latest]
18+
php: [ 7.4, 8.3 ]
19+
wp-version: [ latest ]
20+
wc-version: [ latest ]
3621

3722
steps:
3823
- name: Install SVN

0 commit comments

Comments
 (0)