-
Notifications
You must be signed in to change notification settings - Fork 30
38 lines (31 loc) · 1.06 KB
/
node.js.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
name: CI
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
node-version: [18.x, 20.x, 21.x]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.node-version }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.node-version }}-npm-lock-
- name: Use Node.js ${{ env.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ env.node-version }}
- name: Install dependencies
run: |
npm install
- name: Run tests
run: |
npm test