-
Notifications
You must be signed in to change notification settings - Fork 335
ci: remove dev branch jobs and add static.sh #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/usr/bin/env bash | ||
| set -eu | ||
|
|
||
| cd -- "$(dirname "$0")/.." | ||
|
|
||
| if [[ ! -f ./ci/out/profile.txt ]]; then | ||
| echo "No coverage profile found, run 'make test' first" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -f ./ci/out/coverage.html ]]; then | ||
| echo "No coverage report found, run 'make test' first" | ||
| exit 1 | ||
| fi | ||
|
|
||
| rm -rf ./ci/out/static | ||
| mkdir -p ./ci/out/static | ||
| cp ./ci/out/coverage.html ./ci/out/static/coverage.html | ||
| percent=$(go tool cover -func ./ci/out/profile.txt | tail -n1 | awk '{print $3}' | tr -d '%') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set pipefail? |
||
| wget -O ./ci/out/static/coverage.svg "https://img.shields.io/badge/coverage-${percent}%25-success" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't curl more universal option?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: you can parametrize batch color depending on the percent (high/medium/low) |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd --bonus 👍 for the edge case, but I'm curious if you stumbled upon it :)