-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.23 KB
/
nodejs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Node CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Set up npm cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/nodejs.yml') }}
restore-keys: |
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/nodejs.yml') }}
${{ runner.OS }}-node-v${{ matrix.node }}-
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm test
env:
CI: true
NODE_ENV: 'test'
PORT: 3000
SECRET_HEX: '827d263847500d926a520be9c69137906dcc05df5a326ea2262f52d4f9db37b9'
WHITELIST_ORIGINS: '["http://localhost"]'