Skip to content

Commit ecdabc9

Browse files
committed
add GitHub Actions
1 parent 71600df commit ecdabc9

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
paths:
8+
- "**.js"
9+
- "package.json"
10+
- ".github/workflows/ci.yml"
11+
12+
jobs:
13+
test:
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macOS-latest]
17+
node: ["14", "12", engines]
18+
exclude:
19+
# On Windows, run tests with only the LTS environments.
20+
- os: windows-latest
21+
node: engines
22+
- os: windows-latest
23+
node: "14"
24+
# On macOS, run tests with only the LTS environments.
25+
- os: macOS-latest
26+
node: engines
27+
- os: macOS-latest
28+
node: "14"
29+
30+
runs-on: ${{ matrix.os }}
31+
steps:
32+
- uses: actions/checkout@v2
33+
34+
- name: Get Node.JS version from package.json
35+
if: matrix.node == 'engines'
36+
id: get-version
37+
run: echo ::set-output name=node::$(npx --q minimum-node-version)
38+
39+
- uses: actions/setup-node@v2-beta
40+
if: matrix.node != 'engines'
41+
with:
42+
node-version: ${{ matrix.node }}
43+
44+
- uses: actions/setup-node@v2-beta
45+
if: matrix.node == 'engines'
46+
with:
47+
node-version: ${{steps.get-version.outputs.node}}
48+
49+
- run: npm install
50+
51+
- run: npm run report -- --colors
52+
53+
- name: Upload coverage to Codecov
54+
uses: codecov/codecov-action@v1
55+
with:
56+
file: ./coverage/coverage-final.json

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.js"
7+
- "**eslint**"
8+
- "package.json"
9+
- ".github/workflows/lint.yml"
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js
16+
uses: actions/setup-node@v2-beta
17+
with:
18+
node-version: 14
19+
- run: npm install
20+
- run: npm run lint

0 commit comments

Comments
 (0)