File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments