Skip to content

Commit a49e3e7

Browse files
committed
setup CI
1 parent 0f3d7d9 commit a49e3e7

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
node-version: [12, 14, 16]
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v2
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
30+
- name: Use cached node_modules
31+
id: cache
32+
uses: actions/cache@v2
33+
with:
34+
path: node_modules
35+
key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}
36+
restore-keys: |
37+
nodeModules-
38+
- name: Install dependencies
39+
if: steps.cache.outputs.cache-hit != 'true'
40+
run: npm install
41+
env:
42+
CI: true
43+
44+
- name: Test
45+
run: npm test
46+
env:
47+
CI: true

0 commit comments

Comments
 (0)