Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/javascript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:
# Runs the QUnit tests for WordPress.
test-js:
name: QUnit Tests
uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
uses: desrosj/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@update/js-workflow
with:
old-branch: true
permissions:
contents: read
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/reusable-javascript-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
##
# 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@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
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
Loading