Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): support testing against multiple ESLint versions #237

Merged
merged 1 commit into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
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