-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (47 loc) · 1.23 KB
/
node.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: node
on:
- push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 20
- 18
- 16
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}
- run: npm ci
- run: npm test
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
release:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-lts/*-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-lts/*
- run: npm ci
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.SR_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}