forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 1.99 KB
/
codecov.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
name: Codecov
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, reopened, synchronize]
jobs:
diff:
runs-on: [ubuntu-latest]
outputs:
isRust: ${{ steps.diff.outputs.isRust }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- name: Detect Changes
uses: './.github/actions/diffs'
id: diff
codecov-grcov:
name: Generate code coverage
needs: diff
if: github.event.pull_request.draft == false && needs.diff.outputs.isRust == 'true'
runs-on: [ubuntu-ghcloud]
strategy:
fail-fast: true
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
- run: rustup component add llvm-tools-preview
# Enable caching of the 'librocksdb-sys' crate by additionally caching the
# 'librocksdb-sys' src directory which is managed by cargo
- name: Install grcov, and cache the binary
uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # pin@v3.0.0
with:
crate: grcov
locked: true
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 256
- name: Build
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # pin@v1.0.3
with:
command: build
env:
RUSTFLAGS: '-Cinstrument-coverage'
RUSTDOCFLAGS: '-Cinstrument-coverage'
- name: Run tests
env:
RUSTFLAGS: '-Cinstrument-coverage'
RUSTDOCFLAGS: '-Cinstrument-coverage'
LLVM_PROFILE_FILE: 'codecov-instrumentation-%p-%m.profraw'
run: cargo test
- name: Run grcov
run: grcov . --binary-path target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov
- name: Upload to codecov.io
uses: codecov/codecov-action@e0b68c6749509c5f83f984dd99a76a1c1a231044 # pin v4.0.1