Skip to content

Commit

Permalink
Run type tests against different versions of ESLint and TS during CI
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Mar 2, 2025
1 parent 8683642 commit 5ef2840
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 8 deletions.
51 changes: 46 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ jobs:
run: npm run lint

test:
name:
🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
name: 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
matrix.os }})
strategy:
fail-fast: false
Expand Down Expand Up @@ -118,12 +117,54 @@ jobs:
- name: ▶️ Run test:types script
run: npm run test:types

type-tests:
name: 🧪 Type tests with ESLint ${{ matrix.eslint }} and TypeScript ${{ matrix.ts }}
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
eslint: [8, 9]
ts: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6"]

steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: 📥 Install dependencies
run: npm install

- name: Pack the package
id: pack
run: npm install "$(npm pack | tail -n1)"

- name: 📥 Uninstall @types/eslint
if: matrix.eslint != 8
run: npm uninstall @types/eslint

- name: 📥 Install ESLint version ${{ matrix.eslint }}
run: npm install --save-dev eslint@${{ matrix.eslint }}

- name: 📥 Install TypeScript version ${{ matrix.ts }}
run: npm install --save-dev typescript@${{ matrix.ts }} -f

- name: ▶️ Run test:types script
run: npm run test:types

- name: 📝 List version of ESLint
run: npm why eslint @types/eslint

release:
name: 🚀 Release
needs: [ lint, test ]
needs: [lint, test]
runs-on: ubuntu-latest
if:
github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
if: github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
github.ref) && github.event_name == 'push'
steps:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"ignore": "^5.2.4"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.0",
"@arethetypeswrong/cli": "^0.17.4",
"@babel/core": "^7.22.9",
"@babel/eslint-parser": "^7.22.9",
"@eslint-community/eslint-plugin-mysticatea": "^15.5.1",
Expand All @@ -48,15 +48,15 @@
"cross-spawn": "^7.0.3",
"esbuild": "^0.19.3",
"eslint": "^8.46.0",
"expect-type": "^1.1.0",
"expect-type": "^1.2.0",
"fs-extra": "^10.1.0",
"mocha": "^10.4.0",
"monaco-editor": "^0.47.0",
"nyc": "^15.1.0",
"opener": "^1.5.2",
"rimraf": "^3.0.2",
"semver": "^7.5.4",
"typescript": "^5.6.3",
"typescript": "^5.8.2",
"vite-plugin-eslint4b": "^0.2.1",
"vitepress": "^1.0.0-rc.15"
},
Expand Down

0 comments on commit 5ef2840

Please sign in to comment.