-
Notifications
You must be signed in to change notification settings - Fork 27
76 lines (68 loc) · 2.36 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
# on:
# push:
# branches:
# - "**" # target all branches
# pull_request:
# branches:
# - master
# name: Code Coverage
# env:
# # We partition coverage tests into multiple parts to avoid filling diskspace in a single runner
# PARTITIONS_COUNT: 30
# jobs:
# coverage:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# # This range spans from `0` to `PARTITIONS_COUNT - 1`, where `PARTITIONS_COUNT` is the number of partitions (defined in env var above)
# partition:
# [
# 0,
# 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,
# ]
# steps:
# - name: Install dependencies
# run: sudo apt-get install -yqq build-essential libgtk-3-dev python3 python3-toml
# - uses: actions/checkout@v1
# - name: Install rust
# run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2023-11-01
# - name: Run cargo clean
# run: cargo clean
# - name: Install grcov from cargo
# run: cargo install grcov
# - name: Run coverage tests
# run: python3 build-tools/workspace-partition.py ${{ env.PARTITIONS_COUNT }} ${{ matrix.partition }} | xargs -I {} sh -c 'CARGO_INCREMENTAL=0 RUST_BACKTRACE=full RUST_LOG=debug RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTDOCFLAGS="-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" RUSTUP_TOOLCHAIN=nightly-2023-11-01 cargo test'
# - name: Collect coverage data with grcov
# run: grcov . --source-dir . --output-type lcov --branch --ignore-not-existing --binary-path ./target/debug/ -o grcov-report-${{ matrix.partition }}
# - uses: actions/upload-artifact@v2
# with:
# name: code-coverage-report-${{ matrix.partition }}
# path: grcov-report-${{ matrix.partition }}