-
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.03 KB
/
npm-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
name: npm test
on:
push:
branches: ["main"]
paths:
[
"**.ts",
"jest.config.js*",
"package-lock.json",
".github/workflows/npm-test.yml",
]
pull_request:
branches: ["main", "dev"]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
version: [lts/*, latest]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup node.js @ ${{ matrix.version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- name: Cache node_modules
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-${{ matrix.version }}-build-node-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: npm ci
- name: Run tests
run: npm test