-
Notifications
You must be signed in to change notification settings - Fork 661
62 lines (55 loc) · 1.76 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches:
- mainnet
paths-ignore:
- 'docs/**'
- 'documentation/**'
env:
RUST_BACKTRACE: 0
jobs:
codecov:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Install Rust Stable
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
args: --all --locked --profile ci --features only_testnet
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 }}