Skip to content

Commit 4f1f511

Browse files
committed
Run type tests against different versions of ESLint and TS during CI
1 parent 8683642 commit 4f1f511

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

.github/workflows/ci.yml

+46-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ jobs:
4343
run: npm run lint
4444

4545
test:
46-
name:
47-
🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
46+
name: 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
4847
matrix.os }})
4948
strategy:
5049
fail-fast: false
@@ -118,12 +117,54 @@ jobs:
118117
- name: ▶️ Run test:types script
119118
run: npm run test:types
120119

120+
type-tests:
121+
name: 🧪 Type tests with ESLint ${{ matrix.eslint }} and TypeScript ${{ matrix.ts }}
122+
runs-on: ubuntu-latest
123+
124+
strategy:
125+
fail-fast: false
126+
127+
matrix:
128+
eslint: [8, 9]
129+
ts: ["5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6"]
130+
131+
steps:
132+
- name: ⬇️ Checkout repo
133+
uses: actions/checkout@v4
134+
135+
- name: ⎔ Setup Node
136+
uses: actions/setup-node@v4
137+
with:
138+
node-version: 18
139+
140+
- name: 📥 Install dependencies
141+
run: npm install
142+
143+
- name: Pack the package
144+
id: pack
145+
run: npm install "$(npm pack | tail -n1)"
146+
147+
- name: 📥 Uninstall @types/eslint
148+
if: matrix.eslint != 8
149+
run: npm uninstall @types/eslint
150+
151+
- name: 📥 Install ESLint version ${{ matrix.eslint }}
152+
run: npm install --save-dev eslint@${{ matrix.eslint }}
153+
154+
- name: 📥 Install TypeScript version ${{ matrix.ts }}
155+
run: npm install --save-dev typescript@${{ matrix.ts }} -f
156+
157+
- name: ▶️ Run test:types script
158+
run: npm run test:types
159+
160+
- name: 📝 List version of ESLint
161+
run: npm why eslint @types/eslint
162+
121163
release:
122164
name: 🚀 Release
123-
needs: [ lint, test ]
165+
needs: [lint, test]
124166
runs-on: ubuntu-latest
125-
if:
126-
github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
167+
if: github.repository == 'eslint-community/eslint-plugin-eslint-comments' &&
127168
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
128169
github.ref) && github.event_name == 'push'
129170
steps:

0 commit comments

Comments
 (0)