Skip to content

Commit

Permalink
chore(CI): simplify testing strategy (mysticatea#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Oct 12, 2022
1 parent 872bd3b commit 23f619e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 15 deletions.
63 changes: 49 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,66 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: 0 0 * * 0

jobs:
test:
name: Test
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Install Packages
run: npm install

- name: Lint
run: npm run lint

test:
name: Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ matrix.os }})
strategy:
matrix:
node: [12.x, 10.x, 8.x]
eslint: [6]
node: [8, 10, 12, 14, 16, 18]
os: [ubuntu-latest]
include:
# On other platforms
- os: windows-latest
eslint: 6
node: 18
- os: macos-latest
eslint: 6
node: 18
# On the minimum supported ESLint/Node.js version
- eslint: 6.6.0
node: 8.10.0
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
uses: actions/checkout@v3

- name: Install Node@${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install Packages
run: npm install

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

- name: Test
run: npm test
- name: Send Coverage
run: npm run -s codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: npm run test

# - name: Send Coverage
# run: npm run -s codecov
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"coverage": "opener coverage/lcov-report/index.html",
"codecov": "codecov --disable=gcov -t $CODECOV_TOKEN",
"lint": "eslint lib scripts tests",
"test": "npm run -s lint && nyc mocha \"tests/lib/**/*.js\" --reporter dot",
"test": "nyc mocha \"tests/lib/**/*.js\" --reporter dot",
"update": "node scripts/generate-browser-globals && node scripts/generate-configs && node scripts/generate-rules",
"preversion": "run-s clean update test",
"version": "eslint lib/rules --fix && git add lib",
Expand Down

0 comments on commit 23f619e

Please sign in to comment.