-
Notifications
You must be signed in to change notification settings - Fork 15
156 lines (151 loc) · 4.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Coverage
on:
push:
branches: main
pull_request:
paths:
- code/**
- specs/quint/**
- .github/workflows/coverage.yml
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_RELEASE_DEBUG: 1
RUST_BACKTRACE: short
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
jobs:
integration:
name: Integration
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Quint
run: npm install -g @informalsystems/quint
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2025-01-07 # pin to working nightly
components: llvm-tools-preview
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: |
cargo llvm-cov nextest \
--workspace \
--exclude informalsystems-malachitebft-test-mbt \
--ignore-filename-regex crates/cli \
--all-features \
--no-capture \
--ignore-run-fail \
--lcov \
--output-path lcov-integration.info
- name: Generate text report
run: cargo llvm-cov report
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: integration-coverage
path: code/lcov-integration.info
- name: Upload test results artifact
uses: actions/upload-artifact@v4
with:
name: integration-test-results
path: code/target/nextest/default/junit.xml
mbt:
name: MBT
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Quint
run: npm install -g @informalsystems/quint
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2025-01-07 # pin to working nightly
components: llvm-tools-preview
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov nextest -p informalsystems-malachitebft-test-mbt --all-features --lcov --output-path lcov-mbt.info
- name: Generate text report
run: cargo llvm-cov report
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: mbt-coverage
path: code/lcov-mbt.info
upload-coverage:
name: Upload Coverage
needs: [integration, mbt]
runs-on: ubuntu-latest
steps:
- name: Download integration coverage
uses: actions/download-artifact@v4
with:
name: integration-coverage
- name: Download MBT coverage
uses: actions/download-artifact@v4
with:
name: mbt-coverage
- name: Download integration test results
uses: actions/download-artifact@v4
with:
name: integration-test-results
- name: Upload integration coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov-integration.info
flags: integration
fail_ci_if_error: false
- name: Upload MBT coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov-mbt.info
flags: mbt
fail_ci_if_error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: junit.xml
flags: integration
fail_ci_if_error: false