-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (61 loc) · 2.08 KB
/
test.yml
File metadata and controls
70 lines (61 loc) · 2.08 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Test with jest
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [created]
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # Runs every day at midnight
jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
# - windows-latest
# - macOS-latest
architecture:
- x64
node_version:
- 16
- 18
- 20
- latest
steps:
- uses: actions/checkout@v4
- name: Cache Node.js modules
id: cache-npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list --include dev
- name: Use Node.js ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.architecture }}
- name: Install dependencies
run: npm install --include dev
# env:
# NODE_ENV: development
- name: Run tests
run: npm test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
if: success()
with:
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}