-
-
Notifications
You must be signed in to change notification settings - Fork 47
56 lines (49 loc) · 1.4 KB
/
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: Tests
# This workflow runs standard unit tests to ensure basic integrity and avoid
# regressions on pull-requests (and pushes)
on:
push:
branches:
- master # allthough master is push protected we still keep it
- development
pull_request: # runs on all PR
branches-ignore:
- release-* # on release we run an extended workflow so no need for this
jobs:
lint:
name: Javascript standard lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- run: npm install
- run: npm run lint
unittest:
name: unit tests
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
node: [16, 18, 20]
steps:
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v3
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm i
- run: npm run test:coverage
# with the following action we enforce PRs to have a high coverage
# and ensure, changes are tested well enough so that coverage won't fail
- name: check coverage
uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
with:
path: './coverage/lcov.info'
min_coverage: 95