-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
73 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
#!/bin/bash | ||
# Downloads and merges coverage files from multiple steps into a single file (build/TEST-go-unit.cov). | ||
# Usage: merge.sh <step1> <step2> ... Where <step> is the id of the step that contains the coverage artifact.# | ||
|
||
set -exuo pipefail | ||
|
||
COV_FILE="build/TEST-go-unit.cov" | ||
# Space | ||
COV_PATHS="" | ||
|
||
go install github.com/wadey/gocovmerge@latest | ||
mkdir -p unit-tests-2204 && buildkite-agent artifact download --step unit-tests-2204 $COV_FILE unit-tests-2204 | ||
mkdir -p unit-tests-2204-arm64 && buildkite-agent artifact download --step unit-tests-2204-arm64 $COV_FILE unit-tests-2204-arm64 | ||
ls unit-tests-2204 | ||
ls unit-tests-2204-arm64 | ||
mkdir -p build && gocovmerge unit-tests-2204/$COV_FILE unit-tests-2204-arm64/$COV_FILE > $COV_FILE | ||
cat build/TEST-go-unit.cov | ||
mkdir -p build | ||
|
||
for STEP_ID in "$@"; do | ||
mkdir -p $STEP_ID | ||
buildkite-agent artifact download --step $STEP_ID $COV_FILE $STEP_ID | ||
COV_PATHS="${COV_PATHS} $STEP_ID/$COV_FILE" | ||
done | ||
|
||
gocovmerge $COV_PATHS > $COV_FILE | ||
echo "Merged coverage file: $COV_FILE. See artifacts" |