-
Notifications
You must be signed in to change notification settings - Fork 18
43 lines (35 loc) · 1.15 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
name: Tests
on: [push, pull_request]
env:
CI: true
NODE_COV: 20 # The Node.js version to run coverage on
jobs:
run:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18, 20]
os: [ubuntu-latest, windows-latest]
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install yarn dependencies
run: yarn install
- name: Run Jest tests
run: yarn test --runInBand
if: "!(startsWith(matrix.os, 'ubuntu') && matrix.node == env.NODE_COV)"
- name: Run Jest tests with coverage
run: yarn test --runInBand --coverage
if: startsWith(matrix.os, 'ubuntu') && matrix.node == env.NODE_COV
- name: Run Coveralls
uses: coverallsapp/github-action@master
if: startsWith(matrix.os, 'ubuntu') && matrix.node == env.NODE_COV
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./.coverage/lcov.info"