Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add coverage figures collector #3

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading