Skip to content

Commit 34a3405

Browse files
committed
Build: move build and lint to discrete action steps
- only run lint on latest node
1 parent 66ef8b2 commit 34a3405

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/node.js.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ jobs:
7171
run: npx playwright-webkit install-deps
7272
if: "matrix.NPM_SCRIPT == 'test:browser' && contains(matrix.BROWSERS, 'WebkitHeadless')"
7373

74+
- name: Build jQuery
75+
run: npx grunt
76+
if: "matrix.NPM_SCRIPT == 'test:browserless' || matrix.NPM_SCRIPT == 'test:browser' || matrix.NPM_SCRIPT == 'test:esmodules'"
77+
78+
- name: Lint code
79+
run: npm run lint
80+
if: "matrix.NODE_VERSION == '18.x'"
81+
7482
- name: Run tests
7583
env:
7684
BROWSERS: ${{ matrix.BROWSERS }}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
"build-all-variants": "grunt custom:slim --esm --filename=jquery.slim.module.js && grunt custom --esm --filename=jquery.module.js && grunt custom:slim --filename=jquery.slim.js && grunt custom",
3636
"jenkins": "npm run test:browserless",
3737
"lint:dev": "eslint .",
38-
"lint:dist": "eslint --no-ignore dist/jquery.js dist/jquery.slim.js dist-module/jquery.module.js dist-module/jquery.slim.module.js",
38+
"lint:dist": "eslint --no-ignore --no-error-on-unmatched-pattern dist/jquery.js dist/jquery.slim.js dist-module/jquery.module.js dist-module/jquery.slim.module.js",
3939
"lint:json": "jsonlint --quiet package.json",
4040
"lint:cache": "concurrently -r \"npm:lint:dev -- --cache\" \"npm:lint:json\"",
4141
"lint": "concurrently -r \"npm:lint:dev\" \"npm:lint:json\" && npm run lint:dist",
4242
"prepare": "husky install",
4343
"start": "grunt watch",
44-
"test:browserless": "grunt && npm run test:node_smoke_tests && grunt test:slow",
45-
"test:browser": "grunt && grunt karma:main",
46-
"test:esmodules": "grunt && grunt karma:esmodules",
44+
"test:browserless": "npm run test:node_smoke_tests && grunt test:slow",
45+
"test:browser": "grunt karma:main",
46+
"test:esmodules": "grunt karma:esmodules",
4747
"test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main",
4848
"test:selector-native": "grunt test:prepare && grunt custom:-selector && grunt karma:main",
4949
"test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main",
@@ -52,7 +52,7 @@
5252
"test:node_smoke_tests:slim-module": "grunt node_smoke_tests:module:./dist-module/jquery.slim.module.js && grunt node_smoke_tests:module:jquery/slim",
5353
"test:node_smoke_tests:slim-commonjs": "grunt node_smoke_tests:commonjs:./dist/jquery.slim.js && grunt node_smoke_tests:commonjs:jquery/slim",
5454
"test:node_smoke_tests": "npm run test:node_smoke_tests:full-module && npm run test:node_smoke_tests:slim-module && npm run test:node_smoke_tests:full-commonjs && npm run test:node_smoke_tests:slim-commonjs",
55-
"test": "npm run test:browserless && npm run test:slim && npm run test:no-deprecated && npm run test:selector-native && grunt && grunt test:slow && grunt karma:main && grunt karma:esmodules"
55+
"test": "grunt && npm run lint && npm run test:browserless && npm run test:slim && npm run test:no-deprecated && npm run test:selector-native && grunt && grunt test:slow && grunt karma:main && grunt karma:esmodules"
5656
},
5757
"homepage": "https://jquery.com",
5858
"author": {

0 commit comments

Comments
 (0)