mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
f2a4205e7d
This applies several updates to the following 3rd-party GitHub Actions: - `actions/setup-node` - `actions/cache` - `actions/upload-artifact` - `slackapi/slack-github-action` - `codecov/codecov-action`. See #61564. git-svn-id: https://develop.svn.wordpress.org/trunk@59208 602fd350-edb4-49c9-b593-d223f7449a82
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
##
|
|
# A reusable workflow that runs JavaScript tests.
|
|
##
|
|
name: JavaScript tests
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
# Runs the QUnit test suite.
|
|
#
|
|
# Performs the following steps:
|
|
# - Checks out the repository.
|
|
# - Sets up Node.js.
|
|
# - Logs debug information about the GitHub Action runner.
|
|
# - Installs npm dependencies.
|
|
# - Run the WordPress QUnit tests.
|
|
# - Ensures version-controlled files are not modified or deleted.
|
|
test-js:
|
|
name: Run QUnit tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
with:
|
|
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: npm
|
|
|
|
- name: Log debug information
|
|
run: |
|
|
npm --version
|
|
node --version
|
|
git --version
|
|
|
|
- name: Install npm Dependencies
|
|
run: npm ci
|
|
|
|
- name: Run QUnit tests
|
|
run: npm run grunt qunit:compiled
|
|
|
|
- name: Ensure version-controlled files are not modified or deleted
|
|
run: git diff --exit-code
|