Skip to content

Commit

Permalink
chore(CI): simplify testing strategy (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Oct 13, 2022
1 parent e8eabf4 commit c970565
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 247 deletions.
65 changes: 55 additions & 10 deletions .github/workflows/CI.yml
@@ -1,32 +1,77 @@
name: CI
on:
push: {}
pull_request: {}
push:
pull_request:

jobs:
main:
lint:
name: ⬣ Lint
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

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

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

- name: 📥 Install dependencies
run: npm install

- name: ▶️ Run lint script
run: npm run lint

test:
name:
🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
matrix.os }})
strategy:
matrix:
eslint: [7, 8]
node: [12.22.0, 12, 14.17.0, 14, 16, 18]
runs-on: ubuntu-latest
eslint: [8]
node: [12.22.0, 12, 14.17.0, 14, 16.0.0, 16, 18]
os: [ubuntu-latest]
include:
# On other platforms
- os: windows-latest
eslint: 8
node: 18
- os: macos-latest
eslint: 8
node: 18
# On old ESLint versions
- eslint: 7
node: 18
os: ubuntu-latest
# On the minimum supported ESLint/Node.js version
- eslint: 7.0.0
node: 12.22.0
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.10.1
uses: styfle/cancel-workflow-action@0.11.0

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

- name: ⎔ Setup node
- name: ⎔ Setup Node v${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
node-version: ${{ matrix.node }}

- name: 📥 Download deps
- name: 📥 Install dependencies
run: npm ci

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

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

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v3

0 comments on commit c970565

Please sign in to comment.