-
Notifications
You must be signed in to change notification settings - Fork 719
60 lines (53 loc) · 1.87 KB
/
codecov.yml
File metadata and controls
60 lines (53 loc) · 1.87 KB
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
name: Code Coverage
on:
schedule:
- cron: '0 15 * * 0' # Sunday 15:00 UTC (7am or 8am Pacific time)
env:
RUST_BACKTRACE: 0
jobs:
codecov:
name: Run Code Coverage
runs-on: ubuntu-latest
env:
RUSTC_BOOTSTRAP: 1
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: Set up rust-cache
uses: Swatinem/rust-cache@v2
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
# Don't run tests in parallel because codecov with rayon will blow the stack.
args: --all --locked --profile ci --features only_testnet,leo-test-framework/no_parallel
env:
CARGO_INCREMENTAL: "0"
- name: Install dependencies for code coverage
run: |
sudo apt-get update
sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
- name: Generate coverage report
run: |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
tar xzf master.tar.gz
cd kcov-master
mkdir build && cd build
cmake .. && make
make install DESTDIR=../../kcov-build
cd ../..
rm -rf kcov-master
for file in target/ci/deps/*-*; do if [[ "$file" != *\.* ]]; then mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --exclude-region='@kcov_skip(start):@kcov_skip(end)' --verify "target/cov/$(basename $file)" "$file"; fi done
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}