Skip to content

Commit 77bf465

Browse files
author
Chris Brody
authored
add Node.js test action to GitHub workflows (#294)
* Create nodejs.yml * `npm i` rather than `npm ci` since this project uses yarn.lock rather than package-lock.json * use multiple lines for node-version * use matrix to run on macOS & Windows (skip Ubuntu for now, at least) * add Node.js 8 * add comment with matrix ref links
1 parent 34184c3 commit 77bf465

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
# ref:
19+
# - https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
20+
# - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix
21+
matrix:
22+
os:
23+
- macos-latest
24+
- windows-latest
25+
node-version:
26+
- 8.x
27+
- 10.x
28+
- 12.x
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Use Node.js ${{ matrix.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ matrix.node-version }}
36+
- run: npm i
37+
- run: npm run build --if-present
38+
- run: npm test
39+
env:
40+
CI: true

0 commit comments

Comments
 (0)