Skip to content

Commit e269998

Browse files
committed
Build/Test Tools: Revert [62533], [62534].
More work is needed to ensure these changes do not introduce failures in old branches. Reverts [62533], [62534]. See #64893. git-svn-id: https://develop.svn.wordpress.org/trunk@62536 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 49f3e9d commit e269998

16 files changed

Lines changed: 57 additions & 160 deletions

.github/workflows/reusable-check-built-files.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ jobs:
2424
# - Builds Emoji files.
2525
# - Builds bundled Root Certificate files.
2626
# - Builds WordPress.
27-
# - Checks for uncommitted changes.
28-
# - Stages all uncommitted changes and adds any unversioned files.
29-
# - Displays a diff of all staged changes.
30-
# - Saves staged changes to a .diff file.
27+
# - Checks for changes to versioned files.
28+
# - Displays the result of git diff for debugging purposes.
29+
# - Saves the diff to a patch file.
3130
# - Uploads the patch file as an artifact.
3231
update-built-files:
3332
name: Check and update built files
@@ -79,26 +78,22 @@ jobs:
7978
- name: Build WordPress
8079
run: npm run build:dev
8180

82-
- name: Check for uncommitted changes
81+
- name: Check for changes to versioned files
8382
id: built-file-check
8483
run: |
85-
if [ -z "$(git status --porcelain)" ]; then
84+
if git diff --quiet; then
8685
echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT"
8786
else
8887
echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT"
8988
fi
9089
91-
- name: Stage all changes for diff generation
90+
- name: Display changes to versioned files
9291
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
93-
run: git add -A
94-
95-
- name: Display all uncommitted changes
96-
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
97-
run: git diff --cached
92+
run: git diff
9893

9994
- name: Save diff to a file
10095
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
101-
run: git diff --cached --binary > ./changes.diff
96+
run: git diff > ./changes.diff
10297

10398
# Uploads the diff file as an artifact.
10499
- name: Upload diff file as artifact

.github/workflows/reusable-coding-standards-javascript.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# - Logs debug information about the GitHub Action runner.
2525
# - Installs npm dependencies.
2626
# - Run the WordPress JSHint checks.
27-
# - Checks for any uncommitted changes.
27+
# - Ensures version-controlled files are not modified or deleted.
2828
jshint:
2929
name: JavaScript checks
3030
runs-on: ubuntu-24.04
@@ -57,10 +57,5 @@ jobs:
5757
- name: Run JSHint
5858
run: npm run grunt jshint
5959

60-
- name: Check for uncommitted changes
61-
run: |
62-
if [ -n "$(git status --porcelain)" ]; then
63-
echo "Uncommitted changes detected:"
64-
git status --porcelain
65-
exit 1
66-
fi
60+
- name: Ensure version-controlled files are not modified or deleted
61+
run: git diff --exit-code

.github/workflows/reusable-coding-standards-php.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# - Generate a report for displaying issues as pull request annotations.
3838
# - Runs PHPCS on the `tests` directory without (warnings included).
3939
# - Generate a report for displaying `test` directory issues as pull request annotations.
40-
# - Checks for any uncommitted changes.
40+
# - Ensures version-controlled files are not modified or deleted.
4141
phpcs:
4242
name: PHP checks
4343
runs-on: ubuntu-24.04
@@ -105,10 +105,5 @@ jobs:
105105
if: ${{ inputs.old-branch }}
106106
run: phpcbf
107107

108-
- name: Check for uncommitted changes
109-
run: |
110-
if [ -n "$(git status --porcelain)" ]; then
111-
echo "Uncommitted changes detected:"
112-
git status --porcelain
113-
exit 1
114-
fi
108+
- name: Ensure version-controlled files are not modified during the tests
109+
run: git diff --exit-code

.github/workflows/reusable-end-to-end-tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# - Install additional languages.
6262
# - Run the E2E tests.
6363
# - Uploads screenshots and HTML snapshots as an artifact.
64-
# - Checks for any uncommitted changes.
64+
# - Ensures version-controlled files are not modified or deleted.
6565
e2e-tests:
6666
name: SCRIPT_DEBUG ${{ inputs.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}
6767
runs-on: ubuntu-24.04
@@ -153,10 +153,5 @@ jobs:
153153
if-no-files-found: ignore
154154
include-hidden-files: true
155155

156-
- name: Check for uncommitted changes
157-
run: |
158-
if [ -n "$(git status --porcelain)" ]; then
159-
echo "Uncommitted changes detected:"
160-
git status --porcelain
161-
exit 1
162-
fi
156+
- name: Ensure version-controlled files are not modified or deleted
157+
run: git diff --exit-code

.github/workflows/reusable-javascript-tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# - Logs debug information about the GitHub Action runner.
2626
# - Installs npm dependencies.
2727
# - Run the WordPress QUnit tests.
28-
# - Checks for any uncommitted changes.
28+
# - Ensures version-controlled files are not modified or deleted.
2929
test-js:
3030
name: Run QUnit tests
3131
runs-on: ubuntu-24.04
@@ -67,10 +67,5 @@ jobs:
6767
- name: Run QUnit tests
6868
run: npm run grunt qunit:compiled
6969

70-
- name: Check for uncommitted changes
71-
run: |
72-
if [ -n "$(git status --porcelain)" ]; then
73-
echo "Uncommitted changes detected:"
74-
git status --porcelain
75-
exit 1
76-
fi
70+
- name: Ensure version-controlled files are not modified or deleted
71+
run: git diff --exit-code

.github/workflows/reusable-javascript-type-checking-v1.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# - Configures caching for TypeScript build info.
2424
# - Runs JavaScript type checking.
2525
# - Saves the TypeScript build info.
26-
# - Checks for any uncommitted changes.
26+
# - Ensures version-controlled files are not modified or deleted.
2727
typecheck:
2828
name: Run JavaScript type checking
2929
runs-on: ubuntu-24.04
@@ -72,10 +72,5 @@ jobs:
7272
*.tsbuildinfo
7373
key: "ts-build-info-${{ github.run_id }}"
7474

75-
- name: Check for uncommitted changes
76-
run: |
77-
if [ -n "$(git status --porcelain)" ]; then
78-
echo "Uncommitted changes detected:"
79-
git status --porcelain
80-
exit 1
81-
fi
75+
- name: Ensure version-controlled files are not modified or deleted
76+
run: git diff --exit-code

.github/workflows/reusable-performance-test-v2.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
# - Install MU plugin.
103103
# - Run performance tests.
104104
# - Archive artifacts.
105-
# - Checks for any uncommitted changes.
105+
# - Ensure version-controlled files are not modified or deleted.
106106
performance:
107107
name: Test ${{ inputs.subject == 'base' && inputs.BASE_TAG || inputs.subject }}
108108
runs-on: ubuntu-24.04
@@ -272,10 +272,5 @@ jobs:
272272
if-no-files-found: error
273273
include-hidden-files: true
274274

275-
- name: Check for uncommitted changes
276-
run: |
277-
if [ -n "$(git status --porcelain)" ]; then
278-
echo "Uncommitted changes detected:"
279-
git status --porcelain
280-
exit 1
281-
fi
275+
- name: Ensure version-controlled files are not modified or deleted
276+
run: git diff --exit-code

.github/workflows/reusable-php-compatibility.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# - Make Composer packages available globally.
3131
# - Runs the PHP compatibility tests.
3232
# - Generate a report for displaying issues as pull request annotations.
33-
# - Checks for any uncommitted changes.
33+
# - Ensures version-controlled files are not modified or deleted.
3434
php-compatibility:
3535
name: Run compatibility checks
3636
runs-on: ubuntu-24.04
@@ -86,10 +86,5 @@ jobs:
8686
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
8787
run: cs2pr ./.cache/phpcs-compat-report.xml
8888

89-
- name: Check for uncommitted changes
90-
run: |
91-
if [ -n "$(git status --porcelain)" ]; then
92-
echo "Uncommitted changes detected:"
93-
git status --porcelain
94-
exit 1
95-
fi
89+
- name: Ensure version-controlled files are not modified or deleted
90+
run: git diff --exit-code

.github/workflows/reusable-phpstan-static-analysis-v1.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
# - Configures caching for PHPStan static analysis scans.
3434
# - Runs PHPStan static analysis (with Pull Request annotations).
3535
# - Saves the PHPStan result cache.
36-
# - Checks for any uncommitted changes.
36+
# - Ensures version-controlled files are not modified or deleted.
3737
phpstan:
3838
name: Run PHP static analysis
3939
runs-on: ubuntu-24.04
@@ -102,10 +102,5 @@ jobs:
102102
path: .cache
103103
key: "phpstan-result-cache-${{ github.run_id }}"
104104

105-
- name: Check for uncommitted changes
106-
run: |
107-
if [ -n "$(git status --porcelain)" ]; then
108-
echo "Uncommitted changes detected:"
109-
git status --porcelain
110-
exit 1
111-
fi
105+
- name: Ensure version-controlled files are not modified or deleted
106+
run: git diff --exit-code

.github/workflows/reusable-phpunit-tests-v2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
# - Logs debug information from inside the WordPress Docker container.
8585
# - Install WordPress within the Docker container.
8686
# - Run the PHPUnit tests.
87-
# - Checks for any uncommitted changes.
87+
# - Ensures version-controlled files are not modified or deleted.
8888
test-php:
8989
name: PHP ${{ inputs.php }} / ${{ inputs.multisite && ' Multisite' || 'Single Site' }}${{ inputs.split_slow && ' slow tests' || '' }}${{ inputs.memcached && ' with memcached' || '' }}
9090
runs-on: ${{ inputs.os }}
@@ -208,5 +208,5 @@ jobs:
208208
if: ${{ ! inputs.split_slow }}
209209
run: LOCAL_PHP_XDEBUG=true npm run "test:${PHPUNIT_SCRIPT}" -- -v --group xdebug --exclude-group __fakegroup__
210210

211-
- name: Check for uncommitted changes
211+
- name: Ensure version-controlled files are not modified or deleted
212212
run: git diff --exit-code

0 commit comments

Comments
 (0)