-
Notifications
You must be signed in to change notification settings - Fork 289
64 lines (64 loc) · 2.14 KB
/
codecov.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
name: Code Coverage Report
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
jobs:
code_coverage_report:
name: Generate code coverage report
runs-on: self-hosted
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: setup environment
run: bash ./scripts/dev_setup.sh -b -t -y -m
- run: rustup component add llvm-tools-preview
- uses: taiki-e/install-action@v1
with:
tool: cargo-llvm-cov,nextest
- name: Run code coverage
env:
RUST_LOG: error
run: cargo llvm-cov nextest --build-jobs 8 --lib --lcov --test-threads 12 --no-fail-fast --output-path target/lcov.info
- name: Upload coverage to Codecov, attempt 1
uses: codecov/codecov-action@v1
id: upload_code_coverage_report_1
continue-on-error: true
with:
file: ./target/lcov.info
flags: unittests
fail_ci_if_error: false
verbose: true
# retry upload to resolve random upload failure caused by github and codecov
# https://github.com/starcoinorg/starcoin/pull/3693#issuecomment-1230963051
- name: Wait on failure 1
if: steps.upload_code_coverage_report_1.outcome == 'failure'
run: |
sleep 120s
- name: Upload coverage to Codecov, attempt 2
id: upload_code_coverage_report_2
if: steps.upload_code_coverage_report_1.outcome == 'failure'
uses: codecov/codecov-action@v3
continue-on-error: true
with:
file: ./target/lcov.info
flags: unittests
fail_ci_if_error: false
verbose: true
- name: Wait on failure 2
if: steps.upload_code_coverage_report_2.outcome == 'failure'
run: |
sleep 360s
- name: Upload coverage to Codecov, attempt 3
id: upload_code_coverage_report_3
if: steps.upload_code_coverage_report_2.outcome == 'failure'
uses: codecov/codecov-action@v3
with:
file: ./target/lcov.info
flags: unittests
fail_ci_if_error: false
verbose: true