Skip to content

Commit 03f8df9

Browse files
chore(CI): support testing against multiple ESLint versions (#237)
1 parent 5bf6436 commit 03f8df9

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

.github/workflows/validate.yml

+19-11
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@ name: validate
22
on:
33
push:
44
branches:
5-
- '+([0-9])?(.{+([0-9]),x}).x'
6-
- 'main'
7-
- 'next'
8-
- 'next-major'
9-
- 'beta'
10-
- 'alpha'
11-
- '!all-contributors/**'
5+
- "+([0-9])?(.{+([0-9]),x}).x"
6+
- "main"
7+
- "next"
8+
- "next-major"
9+
- "beta"
10+
- "alpha"
11+
- "!all-contributors/**"
1212
pull_request: {}
1313
jobs:
1414
main:
1515
# ignore all-contributors PRs
1616
if: ${{ !contains(github.head_ref, 'all-contributors') }}
1717
strategy:
1818
matrix:
19+
eslint: [6.8.0, 6, 7.0.0, 7]
1920
node: [12, 14, 16]
2021
runs-on: ubuntu-latest
2122
steps:
@@ -35,7 +36,15 @@ jobs:
3536
with:
3637
useLockFile: false
3738

38-
- name: ▶️ Run validate script
39+
- name: Install ESLint v${{ matrix.eslint }}
40+
run: npm install --no-save --force eslint@${{ matrix.eslint }}
41+
42+
- name: ▶️ Run validate script (without linting)
43+
if: ${{ matrix.eslint != 7 }}
44+
run: npm run validate -- build,test:coverage
45+
46+
- name: ▶️ Run validate script (with linting)
47+
if: ${{ matrix.eslint == 7 }}
3948
run: npm run validate
4049

4150
- name: ⬆️ Upload coverage report
@@ -44,8 +53,7 @@ jobs:
4453
release:
4554
needs: main
4655
runs-on: ubuntu-latest
47-
if:
48-
${{ github.repository == 'testing-library/eslint-plugin-jest-dom' &&
56+
if: ${{ github.repository == 'testing-library/eslint-plugin-jest-dom' &&
4957
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
5058
github.ref) && github.event_name == 'push' }}
5159
steps:
@@ -73,7 +81,7 @@ jobs:
7381
- name: 🚀 Release
7482
uses: cycjimmy/semantic-release-action@v2
7583
with:
76-
semantic_version: 17
84+
semantic_version: 18
7785
branches: |
7886
[
7987
'+([0-9])?(.{+([0-9]),x}).x',

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"lint": "kcd-scripts lint",
3636
"setup": "npm install && npm run validate -s",
3737
"test": "kcd-scripts test",
38-
"test:update": "npm test -- --updateSnapshot --coverage",
38+
"test:coverage": "npm test -- --coverage",
39+
"test:update": "npm test:coverage -- --updateSnapshot",
3940
"validate": "kcd-scripts validate"
4041
},
4142
"dependencies": {

0 commit comments

Comments
 (0)