-
Notifications
You must be signed in to change notification settings - Fork 260
50 lines (50 loc) · 1.42 KB
/
test.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
42
43
44
45
46
47
48
49
50
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Node.js
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node:
- 22
- 20
- 18
- 16
- 14
steps:
# -----------------------------------------------------------------------
- name: Clone default branch
uses: actions/checkout@v2
with:
persist-credentials: false
# -----------------------------------------------------------------------
- name: Set Node.js version
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
# -----------------------------------------------------------------------
- name: Cache node_modules
id: cache-modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('package.json') }}
# -----------------------------------------------------------------------
- name: Install deps
if: steps.cache-modules.outputs.cache-hit != 'true'
run: |
npm install
# -----------------------------------------------------------------------
- name: Run Tests
run: |
npm test
# -----------------------------------------------------------------------