-
Notifications
You must be signed in to change notification settings - Fork 367
68 lines (57 loc) · 2.06 KB
/
coverage_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
62
63
64
65
66
67
68
name: Code Coverage
on: [pull_request]
jobs:
base_branch_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# with:
# ref: ${{ github.base_ref }} # The base branch of the PR (develop)
- name: Use Node.js v18.14.0
uses: actions/setup-node@v3
with:
node-version: "18.14"
- name: Install dependencies
run: yarn
- name: Run test coverage
run: yarn workspace linode-manager run test
- name: Upload code coverage for ref branch
uses: actions/upload-artifact@v3
with:
name: base-lcov
path: packages/manager/coverage/lcov.info
checks:
runs-on: ubuntu-latest
needs: base_branch_coverage
steps:
- uses: actions/checkout@v3 # Checkout the PR branch
- name: Use Node.js v18.14.0
uses: actions/setup-node@v3
with:
node-version: "18.14"
- name: Download code coverage report from base branch
uses: actions/download-artifact@v3
with:
name: base-lcov
path: packages/manager/coverage/base-lcov
- name: Install dependencies
run: yarn
- name: Debugging - List Contents of Directory
run: |
ls -R
ls -R packages/manager/coverage
working-directory: ${{ github.workspace }}
- name: Run test coverage
run: yarn workspace linode-manager run test
# Compares two code coverage files and generates report as a comment
- name: Generate Code Coverage report
id: code-coverage
uses: barecheck/code-coverage-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }}
lcov-file: "packages/manager/coverage/lcov.info"
base-lcov-file: "packages/manager/coverage/base-lcov/lcov.info"
minimum-ratio: 0 # Fails Github action once code coverage is decreasing
send-summary-comment: true
show-annotations: "warning" # Possible options warning|error