2020-11-10 08:16:39 +00:00
|
|
|
name: nim-libp2p codecov builds
|
|
|
|
|
2021-07-13 08:26:49 +00:00
|
|
|
on:
|
|
|
|
#On push to common branches, this computes the "bases stats" for PRs
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2022-11-16 13:33:42 +00:00
|
|
|
- unstable
|
2021-07-13 08:26:49 +00:00
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
2020-11-10 08:16:39 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-11-16 13:33:42 +00:00
|
|
|
Coverage:
|
2020-11-10 08:16:39 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2022-11-16 13:33:42 +00:00
|
|
|
env:
|
|
|
|
CICOV: YES
|
2020-11-10 08:16:39 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-07-01 18:20:42 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-11-10 08:16:39 +00:00
|
|
|
- name: Run
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y lcov build-essential git curl
|
|
|
|
mkdir coverage
|
|
|
|
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
|
|
|
|
env MAKE="make -j${NPROC}" bash build_nim.sh Nim csources dist/nimble NimBinaries
|
|
|
|
export PATH="$PATH:$PWD/Nim/bin"
|
2021-12-16 18:00:10 +00:00
|
|
|
nimble install_pinned
|
2022-11-16 13:33:42 +00:00
|
|
|
export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage"
|
|
|
|
nimble testnative
|
|
|
|
nimble testpubsub
|
|
|
|
nimble testfilter
|
|
|
|
find nimcache -name *.c -delete
|
2020-11-10 08:16:39 +00:00
|
|
|
lcov --capture --directory nimcache --output-file coverage/coverage.info
|
2021-02-23 03:50:43 +00:00
|
|
|
shopt -s globstar
|
|
|
|
ls `pwd`/libp2p/{*,**/*}.nim
|
|
|
|
lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info
|
2022-11-16 13:33:42 +00:00
|
|
|
genhtml coverage/coverage.f.info --output-directory coverage/output
|
2020-11-10 08:16:39 +00:00
|
|
|
bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports"
|
|
|
|
- uses: actions/upload-artifact@master
|
|
|
|
with:
|
|
|
|
name: coverage
|
2020-11-11 14:22:39 +00:00
|
|
|
path: coverage
|