-
Notifications
You must be signed in to change notification settings - Fork 5
112 lines (109 loc) · 3.79 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
on:
workflow_dispatch:
workflow_call:
push:
branches: [main]
pull_request:
branches: [main]
name: 🔎 Code Coverage
jobs:
grcov:
name: 🔎 grcov Code Coverage
if: |
!startsWith(github.event.head_commit.message, 'ci:')
&& !startsWith(github.event.head_commit.message, 'ci(')
&& !startsWith(github.event.head_commit.message, 'docs:')
&& !startsWith(github.event.head_commit.message, 'docs(')
&& !startsWith(github.event.head_commit.message, 'style:')
&& !startsWith(github.event.head_commit.message, 'style(')
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
# - aarch64-unknown-linux-gnu
# - aarch64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest
# - target: aarch64-unknown-linux-gnu
# os: ubuntu-latest
# - target: aarch64-apple-darwin
# os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: 🎟 Checkout Git Repository
id: checkout_repository_step
uses: actions/checkout@v2
- name: 🧰 Install Rust Toolchain
id: install_toolchain_step
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly # Required for -Zprofile
override: true
target: ${{ matrix.target }}
- name: 🗂 Set up cargo cache
id: setup_cache_step
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: 🧪 Execute tests
id: execute_tests_step
uses: actions-rs/cargo@v1
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
with:
command: test
args: --workspace --target ${{ matrix.target }}
- name: 💽 Pre-Installing grcov
id: preinstall_grcov_step
uses: actions-rs/install@v0.1
with:
crate: grcov
use-tool-cache: true
- name: 🔎 Gather Coverage Data
id: coverage_gather_step
uses: actions-rs/grcov@v0.1
with:
config: .github/actions-rs/grcov.yml
coveralls-token: ${{ secrets.COVERALLS_TOKEN }}
- name: ⬆ Coveralls Upload
id: coveralls_upload_step
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: ${{ steps.coverage_gather_step.outputs.report }}
grcov_finalize:
name: ✔ Finalize grcov Code Coverage
if: |
!startsWith(github.event.head_commit.message, 'ci:')
&& !startsWith(github.event.head_commit.message, 'ci(')
&& !startsWith(github.event.head_commit.message, 'docs:')
&& !startsWith(github.event.head_commit.message, 'docs(')
&& !startsWith(github.event.head_commit.message, 'style:')
&& !startsWith(github.event.head_commit.message, 'style(')
runs-on: ubuntu-latest
needs: grcov
steps:
- name: ✔ Coveralls Finalization
id: coveralls_finalization_step
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true