Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.

Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.

This also fixes the `grunt clean` command which erroneously deletes `script-loader-packages.php`. This file is re-populated during the build, but deleting it during the clean is undesirable.

Fixes #53606


git-svn-id: https://develop.svn.wordpress.org/trunk@51355 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2021-07-06 18:36:46 +00:00
parent 49159c5fc3
commit ef09cd88de
9 changed files with 53 additions and 1 deletions
+8
View File
@@ -55,6 +55,7 @@ jobs:
# - Logs PHP_CodeSniffer debug information.
# - Runs PHPCS on the full codebase with warnings suppressed.
# - Runs PHPCS on the `tests` directory without warnings suppressed.
# - Ensures version-controlled files are not modified or deleted.
# - todo: Configure Slack notifications for failing scans.
phpcs:
name: PHP coding standards
@@ -94,6 +95,9 @@ jobs:
- name: Check test suite files for warnings
run: phpcs tests -q --report=checkstyle | cs2pr
- name: Ensure version-controlled files are not modified during the tests
run: git diff --exit-code
# Runs the JavaScript coding standards checks.
#
# JSHint violations are not currently reported inline with annotations.
@@ -105,6 +109,7 @@ jobs:
# - Logs updated debug information.
# _ Installs NPM dependencies using install-changed to hash the `package.json` file.
# - Run the WordPress JSHint checks.
# - Ensures version-controlled files are not modified or deleted.
# - todo: Configure Slack notifications for failing tests.
jshint:
name: JavaScript coding standards
@@ -140,3 +145,6 @@ jobs:
- name: Run JSHint
run: npm run grunt jshint
- name: Ensure version-controlled files are not modified or deleted
run: git diff --exit-code