Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Tinymce in text widget #684

Tinymce in text widget

Tinymce in text widget #684

name: JavaScript Tests
on:
push:
branches:
- develop
pull_request:
workflow_dispatch:
jobs:
# Runs the QUnit tests for ClassicPress.
#
# Performs the following steps:
# - Cancels all previous workflow runs for pull requests that have not completed.
# - Checks out the repository.
# - Installs NodeJS.
# - Sets up caching for NPM.
# - Logs debug information.
# - Installs NPM dependencies using install-changed to hash the `package.json` file.
# - Run the ClassicPress QUnit tests.
# - todo: Configure Slack notifications for failing tests.
test-js:
name: QUnit Tests
runs-on: ubuntu-22.04
if: ${{ github.repository == 'ClassicPress/ClassicPress-v2' || github.event_name == 'pull_request' }}
steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Read .nvmrc
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '${{ steps.nvmrc.outputs.NVMRC }}'
- name: Cache NodeJS modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Show debug information
run: |
set +e
set -x
npm --version
node --version
curl --version
git --version
svn --version
php --version
phpunit --version
composer --version
grunt --version
mysql --version
- name: Install dependencies
run: npx install-changed --install-command="npm ci"
- name: Run QUnit tests
run: grunt qunit:compiled