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): simplify testing strategy #1

Merged
merged 1 commit into from
Oct 12, 2022
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
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