-
Notifications
You must be signed in to change notification settings - Fork 132
45 lines (35 loc) · 984 Bytes
/
ci-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
# GitHub actions
# https://docs.github.com/en/free-pro-team@latest/actions
name: ci-test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18.x, 20.x, 21.x]
steps:
- uses: actions/checkout@v3
- name: setup Node.js v${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: run npm scripts
env:
PROXY_SERVER: ${{ secrets.PROXY_SERVER }}
run: |
npm install
npm run lint
npm run build --if-present
npm run test
- name: Report Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-