2020-11-10 08:16:39 +00:00
|
|
|
name: nim-libp2p codecov builds
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
GossipSub:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
nim-options: [
|
|
|
|
"",
|
|
|
|
"-d:libp2p_pubsub_anonymize=true -d:libp2p_pubsub_sign=false -d:libp2p_pubsub_verify=false",
|
2020-12-19 14:43:32 +00:00
|
|
|
"-d:libp2p_pubsub_sign=true -d:libp2p_pubsub_verify=true"
|
2020-11-10 08:16:39 +00:00
|
|
|
]
|
|
|
|
test-program: [
|
|
|
|
"tests/pubsub/testpubsub",
|
2020-12-19 14:43:32 +00:00
|
|
|
"tests/pubsub/testgossipinternal"
|
2020-11-10 08:16:39 +00:00
|
|
|
]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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"
|
|
|
|
nimble install -y --depsOnly
|
2020-11-11 14:22:39 +00:00
|
|
|
export NIM_OPTIONS="--opt:speed -d:debug --verbosity:0 --hints:off --lineDir:on -d:chronicles_log_level=INFO --warning[CaseTransition]:off --warning[ObservableStores]:off --warning[LockLevel]:off --nimcache:nimcache --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage ${{ matrix.nim-options }}"
|
2020-11-10 08:16:39 +00:00
|
|
|
nim c $NIM_OPTIONS -r ${{ matrix.test-program }}
|
|
|
|
cd nimcache; rm *.c; cd ..
|
|
|
|
lcov --capture --directory nimcache --output-file coverage/coverage.info
|
|
|
|
lcov --extract coverage/coverage.info `pwd`/libp2p/* `pwd`/libp2p/**/* `pwd`/libp2p/**/**/* --output-file coverage/coverage.f.info
|
2020-11-11 14:22:39 +00:00
|
|
|
export COV_UUID=`cksum <<< "${{ matrix.test-program }} $NIM_OPTIONS" | cut -f 1 -d ' '`
|
|
|
|
genhtml coverage/coverage.f.info --output-directory coverage/$COV_UUID-output
|
|
|
|
echo ${{ matrix.test-program }} > coverage/$COV_UUID-nim_options.txt
|
|
|
|
echo $NIM_OPTIONS >> coverage/$COV_UUID-nim_options.txt
|
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
|
2020-11-10 08:16:39 +00:00
|
|
|
|
|
|
|
Tests:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
nim-options: [
|
|
|
|
""
|
|
|
|
]
|
|
|
|
test-program: [
|
|
|
|
"tests/testnative",
|
|
|
|
]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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"
|
|
|
|
nimble install -y --depsOnly
|
2020-11-11 14:22:39 +00:00
|
|
|
export NIM_OPTIONS="--opt:speed -d:debug --verbosity:0 --hints:off --lineDir:on -d:chronicles_log_level=INFO --warning[CaseTransition]:off --warning[ObservableStores]:off --warning[LockLevel]:off --nimcache:nimcache --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage ${{ matrix.nim-options }}"
|
2020-11-10 08:16:39 +00:00
|
|
|
nim c $NIM_OPTIONS -r ${{ matrix.test-program }}
|
|
|
|
cd nimcache; rm *.c; cd ..
|
|
|
|
lcov --capture --directory nimcache --output-file coverage/coverage.info
|
|
|
|
lcov --extract coverage/coverage.info `pwd`/libp2p/* `pwd`/libp2p/**/* `pwd`/libp2p/**/**/* --output-file coverage/coverage.f.info
|
2020-11-11 14:22:39 +00:00
|
|
|
export COV_UUID=`cksum <<< "${{ matrix.test-program }} $NIM_OPTIONS" | cut -f 1 -d ' '`
|
|
|
|
genhtml coverage/coverage.f.info --output-directory coverage/$COV_UUID-output
|
|
|
|
echo ${{ matrix.test-program }} > coverage/$COV_UUID-nim_options.txt
|
|
|
|
echo $NIM_OPTIONS >> coverage/$COV_UUID-nim_options.txt
|
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
|
2020-11-10 08:16:39 +00:00
|
|
|
|
|
|
|
Filter:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
nim-options: [
|
|
|
|
"",
|
|
|
|
"-d:libp2p_pki_schemes=secp256k1",
|
|
|
|
"-d:libp2p_pki_schemes=secp256k1;ed25519",
|
|
|
|
"-d:libp2p_pki_schemes=secp256k1;ed25519;ecnist",
|
|
|
|
]
|
|
|
|
test-program: [
|
|
|
|
"tests/testpkifilter",
|
|
|
|
]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- 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"
|
|
|
|
nimble install -y --depsOnly
|
2020-11-11 14:22:39 +00:00
|
|
|
export NIM_OPTIONS="--opt:speed -d:debug --verbosity:0 --hints:off --lineDir:on -d:chronicles_log_level=INFO --warning[CaseTransition]:off --warning[ObservableStores]:off --warning[LockLevel]:off --nimcache:nimcache --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage ${{ matrix.nim-options }}"
|
2020-11-10 08:16:39 +00:00
|
|
|
nim c $NIM_OPTIONS -r ${{ matrix.test-program }}
|
|
|
|
cd nimcache; rm *.c; cd ..
|
|
|
|
lcov --capture --directory nimcache --output-file coverage/coverage.info
|
|
|
|
lcov --extract coverage/coverage.info `pwd`/libp2p/* `pwd`/libp2p/**/* `pwd`/libp2p/**/**/* --output-file coverage/coverage.f.info
|
2020-11-11 14:22:39 +00:00
|
|
|
export COV_UUID=`cksum <<< "${{ matrix.test-program }} $NIM_OPTIONS" | cut -f 1 -d ' '`
|
|
|
|
genhtml coverage/coverage.f.info --output-directory coverage/$COV_UUID-output
|
|
|
|
echo ${{ matrix.test-program }} > coverage/$COV_UUID-nim_options.txt
|
|
|
|
echo $NIM_OPTIONS >> coverage/$COV_UUID-nim_options.txt
|
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
|
2020-11-10 08:16:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|