Merge branch 'main' into upgrade-deps

This commit is contained in:
Jaremy Creechley 2023-07-17 16:31:50 -07:00
commit 067bd54aca
No known key found for this signature in database
GPG Key ID: 4E66FB67B21D3300
4 changed files with 75 additions and 5 deletions

View File

@ -92,7 +92,7 @@ jobs:
path: |
~/.nimble
${{ github.workspace }}/.nimble
key: ${{ matrix.target.os }}-${{ matrix.target.cpu }}-dotnimble-${{ hashFiles('nimble.lock') }}
key: ${{ matrix.builder }}-${{ matrix.target.cpu }}-dotnimble-${{ hashFiles('nimble.lock') }}
- name: Setup Nimble
uses: "./.github/actions/install_nimble"

69
.github/workflows/codecov.yml vendored Normal file
View File

@ -0,0 +1,69 @@
name: Generate and upload code coverage
on:
#On push to common branches, this computes the "bases stats" for PRs
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
All_Tests:
name: All tests
runs-on: ubuntu-20.04
strategy:
matrix:
nim-options: [
""
]
test-program: [
"test"
]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Environment setup
run: |
sudo apt-get update
sudo apt-get install -y lcov build-essential git curl
mkdir coverage
- name: Restore nimble dependencies from cache
id: nimble_deps
uses: actions/cache@v3
with:
path: |
~/.nimble
key: ubuntu-20.04-amd64-${{ hashFiles('nimble.lock') }}
- name: Setup Nimble
uses: "./.github/actions/install_nimble"
with:
os: linux
cpu: x64
- name: Setup Env
run: |
nimble -v
- name: Setup Deps
run: |
nimble install -d
nimble setup
- name: Run tests
run: |
nimble -y --verbose coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: ./coverage/
fail_ci_if_error: true
files: ./coverage/coverage.f.info
flags: unittests
name: codecov-umbrella
verbose: true

View File

@ -42,11 +42,11 @@ task coverage, "generates code coverage report":
var nimSrcs = ""
for f in walkDirRec(".", {pcFile}):
if f.endswith(".nim"): nimSrcs.add " " & f.quoteShell()
if f.endswith(".nim"): nimSrcs.add " " & f.absolutePath.quoteShell()
echo "======== Running Tests ======== "
exec("nim c -r tests/coverage.nim")
# exec("rm nimcache/*.c")
exec("rm nimcache/*.c")
rmDir("coverage"); mkDir("coverage")
echo " ======== Running LCOV ======== "
exec("lcov --capture --directory nimcache --output-file coverage/coverage.info")
@ -54,5 +54,6 @@ task coverage, "generates code coverage report":
echo " ======== Generating HTML coverage report ======== "
exec("genhtml coverage/coverage.f.info --output-directory coverage/report ")
echo " ======== Opening HTML coverage report in browser... ======== "
exec("open coverage/report/index.html")
if findExe("open") != "":
exec("open coverage/report/index.html")

View File

@ -1,6 +1,6 @@
# Package
version = "0.3.1"
version = "0.3.2"
author = "Status Research & Development GmbH"
description = "DHT based on the libp2p Kademlia spec"
license = "MIT"