40 lines (37 loc) · 1.12 KB
/
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
name: Test
on:
workflow_call:
inputs:
os:
required: true
type: string
jobs:
test:
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x]
name: Node v${{ matrix.node-version }} on ${{ inputs.os }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install and build
run: npm ci
- name: Run tests with coverage
run: npm run test -- --coverage && cat ./coverage/lcov.info
env:
CI: true
DISABLE_MOCKED_WARNING: true
- name: Coveralls parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.node-version }}
parallel: true
- name: Run tests in example projects
run: npm run test-examples