Skip to content

Commit 8f643b3

Browse files
committed
fix: CI followup - phpcs-changed file args, allow empty test suite (#1028)
1 parent 0a23250 commit 8f643b3

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/linting.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ jobs:
2222
- name: Run PHPCS (changed lines only)
2323
run: |
2424
if [ "${{ github.event_name }}" = "pull_request" ]; then
25-
vendor/bin/phpcs-changed --git --git-base "${{ github.event.pull_request.base.sha }}"
25+
BASE="${{ github.event.pull_request.base.sha }}"
2626
else
27-
vendor/bin/phpcs-changed --git --git-base "${{ github.event.before }}"
27+
BASE="${{ github.event.before }}"
2828
fi
29+
FILES=$(git diff --name-only --diff-filter=d "$BASE" HEAD -- '*.php')
30+
if [ -z "$FILES" ]; then
31+
echo "No PHP files changed, skipping PHPCS."
32+
exit 0
33+
fi
34+
echo "Changed PHP files:"
35+
echo "$FILES"
36+
echo "$FILES" | xargs vendor/bin/phpcs-changed --git --git-base "$BASE"

phpunit.11.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
displayDetailsOnTestsThatTriggerNotices="true"
1313
displayDetailsOnTestsThatTriggerWarnings="true"
1414
failOnDeprecation="true"
15-
failOnEmptyTestSuite="true"
1615
failOnPhpunitDeprecation="true"
1716
failOnNotice="true"
1817
failOnRisky="true"

phpunit.12.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
displayDetailsOnTestsThatTriggerNotices="true"
1313
displayDetailsOnTestsThatTriggerWarnings="true"
1414
failOnDeprecation="true"
15-
failOnEmptyTestSuite="true"
1615
failOnPhpunitDeprecation="true"
1716
failOnNotice="true"
1817
failOnRisky="true"

0 commit comments

Comments
 (0)