mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-29 10:03:22 +03:00
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: Code Coverage
|
|
on:
|
|
push:
|
|
branches:
|
|
- mainnet
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'documentation/**'
|
|
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
|
|
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 }}
|