Skip to content

Commit 3fd2446

Browse files
committed
Build: In CI run lint only on one Node.js version
Closes gh-652
1 parent beead4a commit 3fd2446

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/workflows/node.js.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,37 @@ on:
66
branches-ignore: "dependabot/**"
77

88
jobs:
9-
build:
9+
build-and-test:
1010
# Update it to `ubuntu-latest` only when:
1111
# - our infra is on Debian >=13 which has ImageMagick 7
1212
# - `ubuntu-latest` resolves to v26.x which has ImageMagick 7
1313
# When doing that, also update the `convert` command to `magick`.
1414
runs-on: ubuntu-24.04
15+
name: ${{ matrix.NAME }} (${{ matrix.NODE_VERSION }})
1516
strategy:
1617
fail-fast: false
1718
matrix:
19+
NAME: [ "test" ]
20+
NPM_SCRIPT: [ "qunit" ]
21+
1822
# Node.js 18 is required by jqueryui.com
1923
# Remember to include the version used in Dockerfile!
2024
NODE_VERSION: [18.x, 20.x, 22.x, 24.x]
25+
include:
26+
- NAME: "lint"
27+
NODE_VERSION: "24.x"
28+
NPM_SCRIPT: "lint"
2129
steps:
2230
- name: Checkout
2331
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2432

2533
- name: Update apt-get cache
2634
run: sudo apt-get update
35+
if: "!contains(matrix.NPM_SCRIPT, 'lint')"
2736

2837
- name: Install xsltproc & ImageMagick 6
2938
run: sudo apt-get install -y xsltproc imagemagick
39+
if: "!contains(matrix.NPM_SCRIPT, 'lint')"
3040

3141
- name: Use Node.js ${{ matrix.NODE_VERSION }}
3242
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
@@ -38,8 +48,9 @@ jobs:
3848
- name: Install dependencies
3949
run: npm ci
4050

41-
- name: Prepare for tests
42-
run: ./node_modules/.bin/grunt prepare
51+
- name: Build
52+
run: npm run build
53+
if: "!contains(matrix.NPM_SCRIPT, 'lint')"
4354

4455
- name: Run tests
45-
run: npm test
56+
run: npm run ${{ matrix.NPM_SCRIPT }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"main": "main.js",
4040
"scripts": {
4141
"build": "grunt prepare",
42-
"eslint": "eslint --cache .",
42+
"lint": "eslint --cache .",
4343
"qunit": "qunit --require ./test/setup.js test/*.js",
44-
"test": "npm run eslint && npm run build && npm run qunit"
44+
"test": "npm run lint && npm run build && npm run qunit"
4545
},
4646
"engines": {
4747
"node": ">=18"

0 commit comments

Comments
 (0)