add GitHub Actions
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "**.js"
|
||||||
|
- "package.json"
|
||||||
|
- ".github/workflows/ci.yml"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
node: ["14", "12", engines]
|
||||||
|
exclude:
|
||||||
|
# On Windows, run tests with only the LTS environments.
|
||||||
|
- os: windows-latest
|
||||||
|
node: engines
|
||||||
|
- os: windows-latest
|
||||||
|
node: "14"
|
||||||
|
# On macOS, run tests with only the LTS environments.
|
||||||
|
- os: macOS-latest
|
||||||
|
node: engines
|
||||||
|
- os: macOS-latest
|
||||||
|
node: "14"
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Get Node.JS version from package.json
|
||||||
|
if: matrix.node == 'engines'
|
||||||
|
id: get-version
|
||||||
|
run: echo ::set-output name=node::$(npx --q minimum-node-version)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2-beta
|
||||||
|
if: matrix.node != 'engines'
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node }}
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2-beta
|
||||||
|
if: matrix.node == 'engines'
|
||||||
|
with:
|
||||||
|
node-version: ${{steps.get-version.outputs.node}}
|
||||||
|
|
||||||
|
- run: npm install
|
||||||
|
|
||||||
|
- run: npm run report -- --colors
|
||||||
|
|
||||||
|
- name: Upload coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v1
|
||||||
|
with:
|
||||||
|
file: ./coverage/coverage-final.json
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "**.js"
|
||||||
|
- "**eslint**"
|
||||||
|
- "package.json"
|
||||||
|
- ".github/workflows/lint.yml"
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v2-beta
|
||||||
|
with:
|
||||||
|
node-version: 14
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run lint
|
||||||
Reference in New Issue
Block a user