Skip to content

Commit 52bace8

Browse files
authored
Set up CI using a GitHub actions (#21)
1 parent ddceaf5 commit 52bace8

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Get sources
15+
uses: actions/checkout@v1
16+
17+
- name: Restore npm cache
18+
uses: actions/cache@v2
19+
with:
20+
path: ~/.npm
21+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-node-
24+
- uses: actions/cache@v2
25+
with:
26+
path: node_modules
27+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-node-modules-
30+
- name: Use Node.js 12
31+
uses: actions/setup-node@v2
32+
with:
33+
node-version: '12'
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Build
39+
run: npm run build --if-present
40+
41+
- name: Test
42+
run: npm run test
43+
env:
44+
CI: true

0 commit comments

Comments
 (0)