-
Notifications
You must be signed in to change notification settings - Fork 13
103 lines (91 loc) · 3.32 KB
/
cargo_llvm_cov.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Code Coverage (llvm-cov)
on:
schedule:
- cron: "0 1 * * *" # UTC timing is every day at 1am UTC
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Disable incremental compilation.
#
# Incremental compilation is useful as part of an edit-build-test-edit cycle,
# as it lets the compiler avoid recompiling code that hasn't changed. However,
# on CI, we're not making small edits; we're almost always building the entire
# project from scratch. Thus, incremental compilation on CI actually
# introduces *additional* overhead to support making future builds
# faster...but no future builds will ever occur in any given CI environment.
#
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
# for details.
CARGO_INCREMENTAL: 0
# Allow more retries for network requests in cargo (downloading crates) and
# rustup (installing toolchains). This should help to reduce flaky CI failures
# from transient network timeouts or other issues.
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
# Don't emit giant backtraces in the CI logs.
RUST_BACKTRACE: short
# RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
jobs:
llvm-cov-nextest:
name: Generate code coverage (nextest)
runs-on: self-hosted
timeout-minutes: 120
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4
- uses: bmwill/rust-cache@fb63fcd7a959767755b88b5af2f5cbf65fb8a127 # pin@v1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@125e82eef6e60d2b0c20d4d1f4cf81db37f68bf3 # pin@cargo-llvm-cov
- name: Install nextest
uses: taiki-e/install-action@7e58f89e24a544d88f7a74c6eed8a3df3fd4c658 # pin@nextest
- name: Update Rust toolchain
run: rustup update stable
- name: Generate code coverage
run: |
cargo llvm-cov clean
RUSTFLAGS="-C debuginfo=0" IOTA_SKIP_SIMTESTS=1 cargo llvm-cov --ignore-run-fail --html nextest -vv -E '!package(iota-bridge)'
report-nextest:
name: Upload report (nextest)
needs: llvm-cov-nextest
runs-on: self-hosted
if: always()
steps:
- name: Pack report
run: tar -czvf nextest_coverage_report.tgz target/llvm-cov/html/
# TEMP
- name: Upload report
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
if: always()
with:
name: nextest_coverage_report.tgz
path: ./nextest_coverage_report.tgz
if-no-files-found: error
retention-days: 1
llvm-cov-simtest:
name: Generate code coverage (simtest)
needs: report-nextest
runs-on: self-hosted
steps:
- name: Generate code coverage
run: |
git clean -fd
./scripts/simtest/codecov.sh
report-simtest:
name: Upload report (simtest)
needs: llvm-cov-simtest
runs-on: self-hosted
if: always()
steps:
- name: Pack report
run: tar -czvf simtest_coverage_report.tgz target/llvm-cov/html/
# TEMP
- name: Upload report
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4
if: always()
with:
name: simtest_coverage_report.tgz
path: ./simtest_coverage_report.tgz
if-no-files-found: error
retention-days: 1