Skip to content

Commit

Permalink
chore(ci): add coverage figures collector
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Fossati <thomas.fossati@linaro.org>
  • Loading branch information
thomas-fossati committed Aug 23, 2024
1 parent 7cb0f9e commit 9fdd031
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/cov.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import os
import re
import sys

# read output of (potentially many invocations of) "go test -cover -short",
# e.g., "coverage: 65.7% of statements"
cover_report_lines = sys.stdin.read()

if len(cover_report_lines) == 0:
sys.exit(2)

# extract min coverage from GITHUB_WORKFLOW, e.g., "60.4%"
min_cover = float(re.findall(r'\d*\.\d+|\d+', os.environ['GITHUB_WORKFLOW'])[0])

for l in cover_report_lines.splitlines():
cover = float(re.findall(r'\d*\.\d+|\d+', l)[0])
if cover < min_cover:
sys.exit(1)

sys.exit(0)
13 changes: 13 additions & 0 deletions scripts/licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

type go-licenses &> /dev/null || go get github.com/google/go-licenses

MODULES+=("github.com/veraison/corim/cocli")

for module in ${MODULES[@]}
do
echo ">> retrieving licenses [ ${module} ]"
go-licenses csv ${module}
done

0 comments on commit 9fdd031

Please sign in to comment.