aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorKevin J Hoerr <kjhoerr@protonmail.com>2021-09-16 15:45:34 -0400
committerKevin J Hoerr <kjhoerr@protonmail.com>2021-09-16 15:45:34 -0400
commit6bbd3f03104e6dcd9da89a8ec5dcb5d992ee3ed5 (patch)
tree6f44b79750ad00267c8840b3aa472ee64aefc66b /public
parent77575aab559f058d886a691eefe262cf0f306710 (diff)
downloadao-coverage-6bbd3f03104e6dcd9da89a8ec5dcb5d992ee3ed5.tar.gz
ao-coverage-6bbd3f03104e6dcd9da89a8ec5dcb5d992ee3ed5.tar.bz2
ao-coverage-6bbd3f03104e6dcd9da89a8ec5dcb5d992ee3ed5.zip
#7 Add Cobertura format
Diffstat (limited to 'public')
-rw-r--r--public/templates/bash.template14
1 files changed, 10 insertions, 4 deletions
diff --git a/public/templates/bash.template b/public/templates/bash.template
index 4eb3a47..375143e 100644
--- a/public/templates/bash.template
+++ b/public/templates/bash.template
@@ -12,6 +12,8 @@ format="tarpaulin"
report=""
token="$COV_TOKEN"
curl_verbosity=""
+content_type="text/html"
+extension="html"
function verbose_say() {
if [ -z "$SILENT" ] && [ "$VERBOSE" == "true" ]; then
@@ -51,6 +53,10 @@ verbose_say
if [ "$format" == "tarpaulin" ]; then
report="${REPORT_FILE:-tarpaulin-report.html}"
+elif [ "$format" == "cobertura" ]; then
+ report="${REPORT_FILE:-cobertura.xml}"
+ content_type="application/xml"
+ extension="xml"
fi
if [[ ! -f "$report" ]]; then
@@ -65,9 +71,9 @@ fi
say "Uploading $report . . ."
response=$(curl -X POST --data-binary "@$report" \
- -H 'Content-Type: text/html' \
+ -H "Content-Type: $content_type" \
$curl_verbosity \
- "$url/v1/$repo/$branch/$commit.html?token=$token&format=$format")
+ "$url/v1/$repo/$branch/$commit.$extension?token=$token&format=$format")
if [ ! -z "$response" ]; then
say "Error uploading report: $response"
@@ -75,10 +81,10 @@ if [ ! -z "$response" ]; then
else
say "Successfully uploaded report!"
say
- say "View uploaded report at: $url/v1/$repo/$branch/$commit.html"
+ say "View uploaded report at: $url/v1/$repo/$branch/$commit.$extension"
say "View coverage badge at: $url/v1/$repo/$branch/$commit.svg"
say
say "Shorthand links are also available, as the latest commit of this branch."
- say "View latest report for branch $branch: $url/v1/$repo/$branch.html"
+ say "View latest report for branch $branch: $url/v1/$repo/$branch.$extension"
say "View latest badge for branch $branch: $url/v1/$repo/$branch.svg"
fi \ No newline at end of file