Skip to content

Commit afa9401

Browse files
committed
Added GitHub Actions Node.js CI Workflow
1 parent 0179afe commit afa9401

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-node:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
node-version: [8.x, 10.x, 12.x]
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: Get npm cache directory
21+
id: npm-cache
22+
run: |
23+
echo "::set-output name=dir::$(npm config get cache)"
24+
- uses: actions/cache@v1
25+
with:
26+
path: ${{ steps.npm-cache.outputs.dir }}
27+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-node-
30+
- name: npm install, build, and test
31+
run: |
32+
npm ci
33+
npm run build --if-present
34+
env:
35+
CI: true

0 commit comments

Comments
 (0)