Skip to content
Snippets Groups Projects
Verified Commit 23dedcf0 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: ci pipeline

parent d3e7b5c7
No related branches found
No related tags found
No related merge requests found
Pipeline #23616 canceled
#!/bin/bash
#
# Code coverage generation
COVERAGE_DIR="${1}"
REPORT_DIR="${2}"
TYPE="${3}"
cd "$COVERAGE_DIR" || exit 1
PKG_LIST=$(go list ./... | grep -v /vendor/)
# Create the coverage files directory
mkdir -p "$REPORT_DIR";
# Create a coverage file for each package
for package in ${PKG_LIST}; do
go test -covermode=count -coverprofile "${REPORT_DIR}/${package##*/}.cov" "$package" ;
done ;
# Merge the coverage profile files
echo 'mode: count' > "${REPORT_DIR}"/coverage.cov ;
tail -q -n +2 "${REPORT_DIR}"/*.cov >> "${REPORT_DIR}"/coverage.cov ;
# Display the global code coverage
go tool cover -func="${REPORT_DIR}"/coverage.cov ;
# If needed, generate HTML report
if [ "$TYPE" == "html" ]; then
go tool cover -html="${REPORT_DIR}"/coverage.cov -o "${REPORT_DIR}/"coverage.html ;
fi
rm -rf ${REPORT_DIR}"/"*.cov
# Remove the coverage files directory
cd - || exit 1
......@@ -3,8 +3,6 @@
{
env.LD_LIBRARY_PATH = lib.makeLibraryPath [ ];
env.APP_NAME = "bob";
# https://devenv.sh/packages/
......@@ -81,6 +79,10 @@ else
buildDate=''$(version date)
fi
if [[ -z "''${HOME}" ]]; then
HOME=$(pwd)
fi
${config.devenv.root}/bin/go-compile.sh \
"${config.devenv.root}/source/" \
"${config.devenv.root}/dist"/ \
......
......@@ -31,7 +31,7 @@
in
{
bob = pkgs.buildGoModule {
pname = "bob";
name = "bob";
# In 'nix develop', we don't need a copy of the source tree
# in the Nix store.
src = ././source;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment