Skip to content

Commit af6d7f6

Browse files
authored
Create node.js.yml
1 parent 9c694af commit af6d7f6

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/node.js.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [12.x, 14.x, 16.x]
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v2
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
31+
- name: Cache dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: ~/.npm
35+
key: ${{ runner.os }}-node-${{ hashFiles('web/package-lock.json') }}-${{ matrix.node-version }}
36+
restore-keys: |
37+
${{ runner.os }}-node-${{ matrix.node-version }}
38+
${{ runner.os }}-node-
39+
40+
- name: Install dependencies
41+
run: npm install
42+
working-directory: ./web
43+
44+
- name: Run tests
45+
run: npm test
46+
working-directory: ./web
47+
48+
- name: Build project
49+
run: npm run build
50+
working-directory: ./web

0 commit comments

Comments
 (0)