51 lines (48 loc) 路 1.63 KB
/
coverage.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
name: Report Coverage
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x]
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Environment log
id: env
run: |
echo "::set-output name=yarn-cache-dir::$(yarn cache dir)"
yarn --version
- name: Get node_modules cache
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Get yarn cache
uses: actions/cache@v1
with:
path: ${{ steps.env.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Generate coverage report
run: |
yarn --version
make test-ci-coverage
# Builds babel-standalone with the regular Babel config
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
IS_PUBLISH=true make build-standalone
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
yarn jest "\-standalone/test"
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}