Skip to content

Commit

Permalink
chore(CI): support testing against multiple ESLint versions (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Dec 19, 2021
1 parent 5bf6436 commit 03f8df9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ name: validate
on:
push:
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
- 'main'
- 'next'
- 'next-major'
- 'beta'
- 'alpha'
- '!all-contributors/**'
- "+([0-9])?(.{+([0-9]),x}).x"
- "main"
- "next"
- "next-major"
- "beta"
- "alpha"
- "!all-contributors/**"
pull_request: {}
jobs:
main:
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
strategy:
matrix:
eslint: [6.8.0, 6, 7.0.0, 7]
node: [12, 14, 16]
runs-on: ubuntu-latest
steps:
Expand All @@ -35,7 +36,15 @@ jobs:
with:
useLockFile: false

- name: ▶️ Run validate script
- name: Install ESLint v${{ matrix.eslint }}
run: npm install --no-save --force eslint@${{ matrix.eslint }}

- name: ▶️ Run validate script (without linting)
if: ${{ matrix.eslint != 7 }}
run: npm run validate -- build,test:coverage

- name: ▶️ Run validate script (with linting)
if: ${{ matrix.eslint == 7 }}
run: npm run validate

- name: ⬆️ Upload coverage report
Expand All @@ -44,8 +53,7 @@ jobs:
release:
needs: main
runs-on: ubuntu-latest
if:
${{ github.repository == 'testing-library/eslint-plugin-jest-dom' &&
if: ${{ github.repository == 'testing-library/eslint-plugin-jest-dom' &&
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
github.ref) && github.event_name == 'push' }}
steps:
Expand Down Expand Up @@ -73,7 +81,7 @@ jobs:
- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 17
semantic_version: 18
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"test": "kcd-scripts test",
"test:update": "npm test -- --updateSnapshot --coverage",
"test:coverage": "npm test -- --coverage",
"test:update": "npm test:coverage -- --updateSnapshot",
"validate": "kcd-scripts validate"
},
"dependencies": {
Expand Down

0 comments on commit 03f8df9

Please sign in to comment.