Skip to content

Commit fab0a4e

Browse files
authored
feat(ci): install nodejs version according to nvmrc (#580)
1 parent cd91b9b commit fab0a4e

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/main.yml

+24-8
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,36 @@ on:
55
branches:
66
- master
77
pull_request: {}
8+
89
jobs:
910
unit:
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v2
13-
- name: Unit Tests
14-
run: |
15-
npm ci
16-
npm run test
14+
15+
- name: Read .nvmrc
16+
run: echo "##[set-output name=nvmrc;]$(cat .nvmrc)"
17+
id: nvm
18+
- name: Setup Node
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ steps.nvm.outputs.nvmrc }}
22+
- run: npm ci
23+
24+
- run: npm run test
25+
1726
lint:
1827
runs-on: ubuntu-latest
1928
steps:
2029
- uses: actions/checkout@v2
21-
- name: Lint
22-
run: |
23-
npm ci
24-
npm run lint
30+
31+
- name: Read .nvmrc
32+
run: echo "##[set-output name=nvmrc;]$(cat .nvmrc)"
33+
id: nvm
34+
- name: Setup Node
35+
uses: actions/setup-node@v1
36+
with:
37+
node-version: ${{ steps.nvm.outputs.nvmrc }}
38+
- run: npm ci
39+
40+
- run: npm run lint

0 commit comments

Comments
 (0)