This repository has been archived by the owner on Mar 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (66 loc) · 2.12 KB
/
javascript-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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