Build/Test Tools: Various minor GitHub Action improvements.

This applies several types of improvements to GitHub Action workflows:
- Updates to inline documentation to ensure accuracy.
- Removal of repetitive or unnecessary debug logging.
- Reorganization of some steps to have configuration steps towards the beginning of jobs.
- Step name updates for consistency across workflows.

Props desrosj, jrf.
See #56793.

git-svn-id: https://develop.svn.wordpress.org/trunk@54851 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2022-11-16 19:32:57 +00:00
parent 66706c996c
commit 7fbcfef25c
8 changed files with 76 additions and 123 deletions

View File

@@ -48,14 +48,15 @@ jobs:
# Performs the following steps:
# - Checks out the repository.
# - Sets up PHP.
# - Logs debug information.
# - Configures caching for PHPCS scans.
# - Installs Composer dependencies (use cache if possible).
# - Installs Composer dependencies.
# - Make Composer packages available globally.
# - Logs PHP_CodeSniffer debug information.
# - Runs PHPCS on the full codebase with warnings suppressed.
# - Generate a report for displaying issues as pull request annotations.
# - Runs PHPCS on the `tests` directory without warnings suppressed.
# - Generate a report for displaying `test` directory issues as pull request annotations.
# - Ensures version-controlled files are not modified or deleted.
phpcs:
name: PHP coding standards
runs-on: ubuntu-latest
@@ -73,11 +74,6 @@ jobs:
coverage: none
tools: composer, cs2pr
- name: Log debug information
run: |
php --version
composer --version
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
# http://man7.org/linux/man-pages/man1/date.1.html
- name: "Get last Monday's date"
@@ -98,9 +94,6 @@ jobs:
- name: Make Composer packages available globally
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
- name: Log PHPCS debug information
run: phpcs -i
- name: Run PHPCS on all Core files
id: phpcs-core
run: phpcs -n --report-full --report-checkstyle=./.cache/phpcs-report.xml
@@ -126,10 +119,9 @@ jobs:
#
# Performs the following steps:
# - Checks out the repository.
# - Sets up Node.js.
# - Logs debug information about the GitHub Action runner.
# - Installs Node.js.
# - Logs updated debug information.
# _ Installs npm dependencies.
# - Installs npm dependencies.
# - Run the WordPress JSHint checks.
# - Ensures version-controlled files are not modified or deleted.
jshint:
@@ -144,14 +136,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version
- name: Install Node.js
- name: Set up Node.js
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version-file: '.nvmrc'
@@ -161,8 +146,10 @@ jobs:
run: |
npm --version
node --version
git --version
svn --version
- name: Install Dependencies
- name: Install npm Dependencies
run: npm ci
- name: Run JSHint