forked from kulshekhar/ts-jest
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.35 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
41
42
43
44
45
46
name: Test
on:
workflow_call:
inputs:
os:
required: true
type: string
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
test:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x]
name: Node v${{ matrix.node-version }} on ${{ inputs.os }}
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # 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