From 23dedcf06dc18563cd478b10cbb427afb1677c47 Mon Sep 17 00:00:00 2001 From: Volker Schukai <volker.schukai@schukai.com> Date: Sun, 30 Jul 2023 00:58:12 +0200 Subject: [PATCH] fix: ci pipeline --- bin/go-coverage.sh | 35 ----------------------------------- devenv.nix | 6 ++++-- flake.nix | 2 +- 3 files changed, 5 insertions(+), 38 deletions(-) delete mode 100755 bin/go-coverage.sh diff --git a/bin/go-coverage.sh b/bin/go-coverage.sh deleted file mode 100755 index 405ffb6..0000000 --- a/bin/go-coverage.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 diff --git a/devenv.nix b/devenv.nix index b355e8c..822d72b 100644 --- a/devenv.nix +++ b/devenv.nix @@ -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"/ \ diff --git a/flake.nix b/flake.nix index 7648996..c5296dc 100644 --- a/flake.nix +++ b/flake.nix @@ -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; -- GitLab