From 34a3405d02ae19e638458d256ccd93d763650c46 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Mon, 10 Jul 2023 23:20:29 -0400 Subject: [PATCH] Build: move build and lint to discrete action steps - only run lint on latest node --- .github/workflows/node.js.yml | 8 ++++++++ package.json | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2f2738b3d16..ed7cfb5b80a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -71,6 +71,14 @@ jobs: run: npx playwright-webkit install-deps if: "matrix.NPM_SCRIPT == 'test:browser' && contains(matrix.BROWSERS, 'WebkitHeadless')" + - name: Build jQuery + run: npx grunt + if: "matrix.NPM_SCRIPT == 'test:browserless' || matrix.NPM_SCRIPT == 'test:browser' || matrix.NPM_SCRIPT == 'test:esmodules'" + + - name: Lint code + run: npm run lint + if: "matrix.NODE_VERSION == '18.x'" + - name: Run tests env: BROWSERS: ${{ matrix.BROWSERS }} diff --git a/package.json b/package.json index c162fa271b7..207c41d936f 100644 --- a/package.json +++ b/package.json @@ -35,15 +35,15 @@ "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", "jenkins": "npm run test:browserless", "lint:dev": "eslint .", - "lint:dist": "eslint --no-ignore dist/jquery.js dist/jquery.slim.js dist-module/jquery.module.js dist-module/jquery.slim.module.js", + "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", "lint:json": "jsonlint --quiet package.json", "lint:cache": "concurrently -r \"npm:lint:dev -- --cache\" \"npm:lint:json\"", "lint": "concurrently -r \"npm:lint:dev\" \"npm:lint:json\" && npm run lint:dist", "prepare": "husky install", "start": "grunt watch", - "test:browserless": "grunt && npm run test:node_smoke_tests && grunt test:slow", - "test:browser": "grunt && grunt karma:main", - "test:esmodules": "grunt && grunt karma:esmodules", + "test:browserless": "npm run test:node_smoke_tests && grunt test:slow", + "test:browser": "grunt karma:main", + "test:esmodules": "grunt karma:esmodules", "test:no-deprecated": "grunt test:prepare && grunt custom:-deprecated && grunt karma:main", "test:selector-native": "grunt test:prepare && grunt custom:-selector && grunt karma:main", "test:slim": "grunt test:prepare && grunt custom:slim && grunt karma:main", @@ -52,7 +52,7 @@ "test:node_smoke_tests:slim-module": "grunt node_smoke_tests:module:./dist-module/jquery.slim.module.js && grunt node_smoke_tests:module:jquery/slim", "test:node_smoke_tests:slim-commonjs": "grunt node_smoke_tests:commonjs:./dist/jquery.slim.js && grunt node_smoke_tests:commonjs:jquery/slim", "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", - "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" + "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" }, "homepage": "https://jquery.com", "author": {