-
Notifications
You must be signed in to change notification settings - Fork 19
43 lines (36 loc) · 967 Bytes
/
run-tests.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
name: Run tests
on:
pull_request:
push:
schedule:
- cron: '0 0 * * *' # every day at midnight
jobs:
test:
name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
os:
- ubuntu-latest
- macos-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm/cache/files
key: dependencies-nodejs-${{ matrix.node-version }}-package-${{ hashFiles('package.json') }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
env:
CI: true
- name: Run tests
run: npm test
env:
CI: true