This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
118 lines (100 loc) · 3.16 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
name: Extra
on:
pull_request:
push:
branches:
- master
env:
RUSTUP_MAX_RETRIES: 10
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
jobs:
coverage:
name: "Coverage"
runs-on: ${{ matrix.cfg.os }}
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
cfg:
- os: self-hosted
grcov:
version: tags/v0.8.6
file: grcov-v0.8.6-x86_64-unknown-linux-gnu.tar.gz
dove: 1.5.5
env:
SKIP_WASM_BUILD: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
RUSTDOCFLAGS: "-Cpanic=abort"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust toolchain
# uses: actions-rs/toolchain@v1
uses: oxidecomputer/actions-rs_toolchain@oxide/master
with:
profile: minimal
override: true
- name: cargo clean
run: cargo clean
- name: get latest grcov binary
uses: dsaltares/[email protected]
with:
repo: mozilla/grcov
# TODO: use `version: "latest"` and wildcard in the `file`
version: ${{ matrix.cfg.grcov.version }}
file: ${{ matrix.cfg.grcov.file }}
- name: unpack grcov release binary
run: |
tar -xvf ${{ matrix.cfg.grcov.file }}
sudo chown runner ./grcov && chmod +x ./grcov
cp grcov ~/.cargo/bin/grcov
rm ${{ matrix.cfg.grcov.file }}
- name: cache Dove
uses: actions/cache@v2
with:
path: ~/.dove
key: ${{ matrix.cfg.os }}-dove-${{ matrix.cfg.dove }}
- name: get Dove
uses: pontem-network/get-dove@main
with:
prerelease: true
version: ${{ matrix.cfg.dove }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build test resources
run: make assets
- name: cargo build tests +profile
uses: actions-rs/cargo@v1
with:
command: test
args: -p=sp-mvm --no-fail-fast -- --test-threads=1
- id: coverage_html
name: coverage analysis with grcov (html)
uses: actions-rs/[email protected]
with:
config: .github/grcov+html.yml
- name: make report artifact
uses: actions/upload-artifact@v1
with:
name: code-coverage-report.html
path: ${{ steps.coverage_html.outputs.report }}
- id: coverage
name: coverage analysis with grcov
uses: actions-rs/[email protected]
with:
config: .github/grcov.yml
- name: make report artifact
uses: actions/upload-artifact@v1
with:
name: code-coverage-report.lcov
path: ${{ steps.coverage.outputs.report }}
- name: upload report to Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ steps.coverage.outputs.report }}