Skip to content

Commit 43d9894

Browse files
committed
Use Publish HTML in CI
1 parent 1e0baa3 commit 43d9894

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

Jenkinsfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ pipeline {
8484
}
8585
post {
8686
success {
87-
archiveArtifacts allowEmptyArchive: false, artifacts: 'coverage.html'
8887
archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
88+
publishHTML([
89+
allowMissing: false,
90+
alwaysLinkToLastBuild: true,
91+
keepAll: false,
92+
reportDir: 'backend-coverage',
93+
reportFiles: 'index.html',
94+
reportName: 'Backend Coverage',
95+
useWrapperFileDirectly: true
96+
])
8997
}
9098
}
9199
}

scripts/ci/test-backend

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ if [ "${1:-}" = "--inside-docker" ]; then
4444
cd /app/backend
4545
[ -z "$(go tool fix -diff ./internal)" ]
4646
go test -json -cover -coverprofile="$DIR/../../coverage.out" ./internal/... | tparse
47-
go tool cover -html="$DIR/../../coverage.out" -o "$DIR/../../coverage.html"
48-
rm -f "$DIR/../../coverage.out"
49-
chown 1000:1000 "$DIR/../../coverage.html"
47+
mkdir "$DIR/../../backend-coverage"
48+
go tool cover -html="/tmp/coverage.out" -o "$DIR/../../backend-coverage/index.html"
49+
rm -f "/tmp/coverage.out"
50+
chown -R 1000:1000 "$DIR/../../backend-coverage"
5051
golangci-lint -v run ./...
5152
else
5253
# run this script from within docker

0 commit comments

Comments
 (0)