generated from tinovyatkin/typescript-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (55 loc) · 1.74 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI
on:
pull_request:
branches:
- master
jobs:
test:
name: Test
env:
CI: true
TERM: xterm-256color
FORCE_COLOR: 3
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node: [13.x, 12.x, 10.x]
exclude:
# On Windows, run tests with only the latest environments.
- os: windows-latest
node: 10.x
- os: windows-latest
node: 13.x
# On macOS, run tests with only the latest environments.
- os: macOS-latest
node: 10.x
- os: macOS-latest
node: 13.x
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- run: yarn install --frozen-lockfile --ignore-optional --non-interactive --silent
- run: node --expose-gc node_modules/jest/bin/jest --forceExit --bail --colors --logHeapUsage --maxWorkers=2 --ci
- name: Upload coverage to Codecov
# https://github.com/codecov/codecov-bash/blob/1044b7a243e0ea0c05ed43c2acd8b7bb7cef340c/codecov#L158
run: npx codecov
-f "./coverage/coverage-final.json"
-y "./.codecov.yml"
-b ${{ github.head_ref }}
-c ${{ github.event.after }}
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}