From b70a2b09153547739700b813411540797f294082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Thu, 13 Oct 2022 02:33:14 +0200 Subject: [PATCH] chore(CI): simplify testing strategy --- .github/workflows/CI.yml | 65 ++++++++++-- package-lock.json | 221 +-------------------------------------- package.json | 18 +--- 3 files changed, 57 insertions(+), 247 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7ed49140..00e26624 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,28 +1,70 @@ name: CI on: - push: {} - pull_request: {} + push: + pull_request: + jobs: - main: + lint: + name: ⬣ Lint + runs-on: ubuntu-latest + steps: + - name: 🛑 Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: ⎔ Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: 📥 Install dependencies + run: npm install + + - name: ▶️ Run lint script + run: npm run lint + + test: + name: + 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ + matrix.os }}) strategy: matrix: - eslint: [7, 8] - node: [12.22.0, 12, 14.17.0, 14, 16, 18] - runs-on: ubuntu-latest + eslint: [8] + node: [12.22.0, 12, 14.17.0, 14, 16.0.0, 16, 18] + os: [ubuntu-latest] + include: + # On other platforms + - os: windows-latest + eslint: 8 + node: 18 + - os: macos-latest + eslint: 8 + node: 18 + # On old ESLint versions + - eslint: 7 + node: 18 + os: ubuntu-latest + # On the minimum supported ESLint/Node.js version + - eslint: 7.0.0 + node: 12.22.0 + os: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: 🛑 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.10.1 + uses: styfle/cancel-workflow-action@0.11.0 - name: ⬇️ Checkout repo uses: actions/checkout@v3 - - name: ⎔ Setup node + - name: ⎔ Setup Node v${{ matrix.node }} uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node }} cache: npm + node-version: ${{ matrix.node }} - - name: 📥 Download deps + - name: 📥 Install dependencies run: npm ci - name: 📥 Install ESLint v${{ matrix.eslint }} @@ -30,3 +72,6 @@ jobs: - name: ▶️ Run test script run: npm run test -- --runInBand + + - name: ⬆️ Upload coverage report + uses: codecov/codecov-action@v3 diff --git a/package-lock.json b/package-lock.json index 770b6043..c6eca145 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "6.0.2", "license": "ISC", "devDependencies": { - "@typescript-eslint/parser": "^5.39.0", + "@typescript-eslint/parser": "^5.40.0", "doctoc": "^2.2.1", "eslint": "^8.24.0", "eslint-config-prettier": "^8.5.0", @@ -19,7 +19,6 @@ "eslint-plugin-prettier": "^4.2.1", "husky": "^7.0.4", "jest": "^28.1.3", - "jest-runner-eslint": "^1.1.0", "lint-staged": "^12.5.0", "prettier": "^2.7.1", "typescript": "^4.8.4" @@ -1288,12 +1287,6 @@ "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==", "dev": true }, - "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "node_modules/@types/prettier": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz", @@ -2119,62 +2112,6 @@ "safe-buffer": "~5.1.1" } }, - "node_modules/cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/create-jest-runner": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/create-jest-runner/-/create-jest-runner-0.6.0.tgz", - "integrity": "sha512-9ibH8XA4yOJwDLRlzIUv5Ceg2DZFrQFjEtRKplVP6scGKwoz28V27xPHTbXziq2LePAD/xXlJlywhUq1dtF+nw==", - "dev": true, - "dependencies": { - "chalk": "^3.0.0", - "jest-worker": "^25.1.0", - "throat": "^5.0.0" - }, - "bin": { - "create-jest-runner": "generator/index.js" - } - }, - "node_modules/create-jest-runner/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/create-jest-runner/node_modules/jest-worker": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.5.0.tgz", - "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", - "dev": true, - "dependencies": { - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2350,18 +2287,6 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, - "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "dependencies": { - "is-obj": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -3412,15 +3337,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -3917,38 +3833,6 @@ "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/jest-runner-eslint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jest-runner-eslint/-/jest-runner-eslint-1.1.0.tgz", - "integrity": "sha512-XAQnEIuaZ/wHU8YVR4AEka5FBg3P+fnKd/upk8D9lxhejsclgai5gle7Ay4eLQ1+mlh2y5Ya3/AmfYz8FFZKJQ==", - "dev": true, - "dependencies": { - "chalk": "^3.0.0", - "cosmiconfig": "^6.0.0", - "create-jest-runner": "^0.6.0", - "dot-prop": "^5.3.0" - }, - "engines": { - "node": ">=8.10.0" - }, - "peerDependencies": { - "eslint": "^6 || ^7 || ^8", - "jest": "^25.1 || ^26 || ^27 || ^28 || ^29" - } - }, - "node_modules/jest-runner-eslint/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-runtime": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-28.1.3.tgz", @@ -5852,12 +5736,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -7327,12 +7205,6 @@ "integrity": "sha512-m+6nTEOadJZuTPkKR/SYK3A2d7FZrgElol9UP1Kae90VVU4a6mxnPuLiIW1m4Cq4gZ/nWb9GrdVXJCoCazDAbg==", "dev": true }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@types/prettier": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.0.tgz", @@ -7911,52 +7783,6 @@ "safe-buffer": "~5.1.1" } }, - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, - "create-jest-runner": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/create-jest-runner/-/create-jest-runner-0.6.0.tgz", - "integrity": "sha512-9ibH8XA4yOJwDLRlzIUv5Ceg2DZFrQFjEtRKplVP6scGKwoz28V27xPHTbXziq2LePAD/xXlJlywhUq1dtF+nw==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "jest-worker": "^25.1.0", - "throat": "^5.0.0" - }, - "dependencies": { - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "jest-worker": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-25.5.0.tgz", - "integrity": "sha512-/dsSmUkIy5EBGfv/IjjqmFxrNAUpBERfGs1oHROyD7yxjG/w+t0GOJDX8O1k32ySmd7+a5IhnJU2qQFcJ4n1vw==", - "dev": true, - "requires": { - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - } - } - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8084,15 +7910,6 @@ "domhandler": "^4.2.0" } }, - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "requires": { - "is-obj": "^2.0.0" - } - }, "eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -8818,12 +8635,6 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true - }, "is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -9192,30 +9003,6 @@ "source-map-support": "0.5.13" } }, - "jest-runner-eslint": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/jest-runner-eslint/-/jest-runner-eslint-1.1.0.tgz", - "integrity": "sha512-XAQnEIuaZ/wHU8YVR4AEka5FBg3P+fnKd/upk8D9lxhejsclgai5gle7Ay4eLQ1+mlh2y5Ya3/AmfYz8FFZKJQ==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "cosmiconfig": "^6.0.0", - "create-jest-runner": "^0.6.0", - "dot-prop": "^5.3.0" - }, - "dependencies": { - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - } - } - }, "jest-runtime": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-28.1.3.tgz", @@ -10590,12 +10377,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", diff --git a/package.json b/package.json index ff5b7cc0..b7903191 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "eslint-plugin-prettier": "^4.2.1", "husky": "^7.0.4", "jest": "^28.1.3", - "jest-runner-eslint": "^1.1.0", "lint-staged": "^12.5.0", "prettier": "^2.7.1", "typescript": "^4.8.4" @@ -74,21 +73,6 @@ "lines": 100, "statements": 100 } - }, - "projects": [ - { - "displayName": "test", - "testEnvironment": "node" - }, - { - "runner": "jest-runner-eslint", - "displayName": "lint", - "testMatch": [ - "/rules/**/*.js", - "/__tests__/**/*.js", - "/index.js" - ] - } - ] + } } }