-
Notifications
You must be signed in to change notification settings - Fork 17
40 lines (32 loc) · 904 Bytes
/
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
name: Cross-OS Tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
node:
- 18
- 20
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} (Node v${{ matrix.node }})
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/[email protected]
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ubuntu-latest-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ubuntu-latest-node-
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test