-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- '!dependabot/**' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
FORCE_COLOR: 2 | ||
NODE: 18 | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '${{ env.NODE }}' | ||
cache: npm | ||
|
||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Lint | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,44 @@ | ||
name: CI | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'dependabot/**' | ||
- master | ||
- '!dependabot/**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
workflow_dispatch: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 'lts/*' | ||
cache: npm | ||
env: | ||
FORCE_COLOR: 2 | ||
|
||
- name: Install latest npm | ||
run: npm install --global npm@latest | ||
|
||
- name: Install dependencies && npm --version | ||
run: npm ci | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
test: | ||
name: Test on Node.js ${{ matrix.node }} and ${{ matrix.os }} | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
run: | ||
name: Node ${{ matrix.node }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [14, 16, 18] | ||
node: [14, 16, 18, 20] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Use Node.js ${{ matrix.node }} | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: npm | ||
|
||
# HACK: See https://github.com/npm/cli/issues/4341 | ||
- name: Workaround for npm installation failure on Node.js 14 and Windows | ||
if: ${{ startsWith(matrix.node, '14') && startsWith(matrix.os, 'windows') }} | ||
run: npm install --global npm@8.3 | ||
|
||
- name: Install latest npm | ||
run: npm install --global npm@latest && npm --version | ||
|
||
- name: Install dependencies | ||
- name: Install npm dependencies | ||
run: npm ci | ||
|
||
- name: Test | ||
- name: Run tests | ||
run: npm test |