diff --git a/scripts/pull.sh b/scripts/pull.sh index cd406d6..b6af8f4 100755 --- a/scripts/pull.sh +++ b/scripts/pull.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -eo pipefail +set -xeo pipefail cd go-cover git fetch origin diff --git a/scripts/push.sh b/scripts/push.sh index ae12f79..2c6fb0c 100755 --- a/scripts/push.sh +++ b/scripts/push.sh @@ -5,14 +5,16 @@ set -xeo pipefail cd "${INPUTS_PATH}" # generate coverage files + go tool cover -html=cover.out -o "${GITHUB_WORKSPACE}/go-cover/${REVISION}.html" go tool cover -func=cover.out -o "${GITHUB_WORKSPACE}/go-cover/${REVISION}.txt" cp cover.out "${GITHUB_WORKSPACE}/go-cover/${REVISION}.out" # generate incremental coverage files + echo "mode: set" > incremental.out +# grep exits with 1 if no lines are found, so we need to ignore that grep -F -v -x -f "${GITHUB_WORKSPACE}/go-cover/main.out" cover.out >> incremental.out || true -cat incremental.out go tool cover -html=incremental.out -o "${GITHUB_WORKSPACE}/go-cover/${REVISION}-inc.html" go tool cover -func=incremental.out -o "${GITHUB_WORKSPACE}/go-cover/${REVISION}-inc.txt" cp incremental.out "${GITHUB_WORKSPACE}/go-cover/${REVISION}-inc.out" @@ -20,22 +22,26 @@ cp incremental.out "${GITHUB_WORKSPACE}/go-cover/${REVISION} cd "${GITHUB_WORKSPACE}/go-cover" # beautify html + for file in "${REVISION}.html" "${REVISION}-inc.html"; do ex -sc '%s/