Skip to content

Commit

Permalink
Build/Test Tools: Make use of new reusable workflows for 4.8.
Browse files Browse the repository at this point in the history
This updates the 4.8 branch to utilize the new reusable workflows in trunk introduced in [58165].

This also includes backports for a some additional improvements and bug fixes that are necessary for the local development environment to continue working long term:

- The image and platform properties for the mysql container have been updated to always prefer `amd64` containers (#60822).
- `macos-13` is now pinned for MacOS jobs instead of `macos-latest` (#61340).
- Migrating to Docker Compose V2 (#60901).
- Removing the version property from docker-compose.yml (#59416).
- Improvements to how artifacts and comments for Playground testing are generated.
- Removing SVN related commands causing failures (#61216).
- Updating the `actions/github-scripts` action to the latest version.
- Improvements to the `healthcheck` command for the `mysql` container (#58867).

Merges [51673], [53552], [56464], [57918], [58157], [57124], [57125], [57249] to the 4.8 branch.

Props johnbillion, joemcgill, swissspidy, thelovekesh, narenin, mukesh27, JeffPaul, peterwilsoncc, zieladam, ockham, SergeyBiryukov, jorbin, Clorith, afragen, jrf.
See #58867, #61340, #60822, #61216, #60901, #61101, #59416, #59805, #61213.

git-svn-id: https://develop.svn.wordpress.org/branches/4.8@58637 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
desrosj committed Jul 3, 2024
1 parent fc78a8a commit ad20852
Show file tree
Hide file tree
Showing 10 changed files with 239 additions and 593 deletions.
56 changes: 13 additions & 43 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,57 +40,25 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
# Runs the JavaScript coding standards checks.
#
# JSHint violations are not currently reported inline with annotations.
#
# Performs the following steps:
# - Checks out the repository.
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# - Logs updated debug information.
# _ Installs npm dependencies.
# - Run the WordPress JSHint checks.
jshint:
name: JavaScript coding standards
runs-on: ubuntu-latest
timeout-minutes: 20
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}

steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm

- name: Log debug information
run: |
npm --version
node --version
- name: Install Dependencies
run: npm ci

- name: Run JSHint
run: npm run grunt jshint

slack-notifications:
name: Slack Notifications
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
permissions:
actions: read
contents: read
needs: [ jshint ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
Expand All @@ -104,6 +72,8 @@ jobs:
failed-workflow:
name: Failed workflow tasks
runs-on: ubuntu-latest
permissions:
actions: write
needs: [ jshint, slack-notifications ]
if: |
always() &&
Expand All @@ -116,7 +86,7 @@ jobs:
steps:
- name: Dispatch workflow run
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
retries: 2
retry-exempt-status-codes: 418
Expand Down
61 changes: 18 additions & 43 deletions .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,57 +38,29 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}

jobs:
# Runs the QUnit tests for WordPress.
#
# Performs the following steps:
# - Checks out the repository.
# - Logs debug information about the GitHub Action runner.
# - Installs NodeJS.
# - Logs updated debug information.
# _ Installs npm dependencies.
# - Run the WordPress QUnit tests.
# Runs the WordPress Core JavaScript tests.
test-js:
name: QUnit Tests
runs-on: ubuntu-latest
timeout-minutes: 20
uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}

steps:
- name: Checkout repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version
- name: Set up Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.nvmrc'
cache: npm

- name: Log debug information
run: |
npm --version
node --version
- name: Install Dependencies
run: npm ci

- name: Run QUnit tests
run: npm run grunt qunit:compiled

slack-notifications:
name: Slack Notifications
uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk
permissions:
actions: read
contents: read
needs: [ test-js ]
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
with:
calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
secrets:
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
Expand All @@ -98,19 +70,22 @@ jobs:
failed-workflow:
name: Failed workflow tasks
runs-on: ubuntu-latest
needs: [ test-js, slack-notifications ]
permissions:
actions: write
needs: [ slack-notifications ]
if: |
always() &&
github.repository == 'WordPress/wordpress-develop' &&
github.event_name != 'pull_request' &&
github.run_attempt < 2 &&
(
needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
contains( needs.*.result, 'cancelled' ) ||
contains( needs.*.result, 'failure' )
)
steps:
- name: Dispatch workflow run
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
retries: 2
retry-exempt-status-codes: 418
Expand Down
Loading

0 comments on commit ad20852

Please sign in to comment.