-
-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (44 loc) · 1.32 KB
/
run-tests.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
51
52
53
54
55
56
name: Run Tests
on:
push:
branches:
- main
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
node-version: [14, 16, 18]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache dependencies
uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-npm-
- name: Install dependencies
run: npm install
# - name: Run the tests
# run: npm run test
- name: Run the tests with coverage
run: node_modules/.bin/jest tests -- --coverage --coverageReporters json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/coverage-final.json