Closed markwragg closed 6 years ago
Awesome idea! Will try to flip through this at lunch today or tomorrow : D
I would suggest using CodeCov.io for the badge. Mark Kraus and I am working on this: https://github.com/markekraus/CodeCovIo
However, this introduces 2 dependencies: the module mentioned and the account on the service.
Line 63, is it possible to not hardcoded the Test Results string?
It might be possible to use this for multiple badges:
I did consider that but it might be tricky to incorporate the variables in that string.
On 18 May 2018, 00:06 +0100, John McCarthy notifications@github.com, wrote:
Line 63, is it possible to not hardcoded the Test Results string? It might be possible to use this for multiple badges:
• Build • Code coverage • Docs • etc
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Would something like this be acceptable? https://gist.github.com/Midacts/ef0eb1d30f9234c9dd2433a2129187a1
It makes it so:
$Status -is [int]
to conditionally add in the Percentage@Midacts great idea. I've done a refactor of your version of the function and have renamed it to Set-ShieldsIoBadge
as its now a more generic function. I've change the parameter names to match how they are referenced on shields.io: subject, status and color (and i've made it so you can manually specify colour). Also I’ve added a -AsPercentage switch rather than assume people would want all numeric values treated as percentages. Let me know what you think.
Awesome! Looks good from here - will try to merge this in tonight
Side note! there's no real governance model in place, but essentially if someone adds a file here, I sort of assume they have ownership over it and will tag them if folks open related issues/PRs (until they tell me not to : P)
That's fine with me :).
On Fri, 18 May 2018 at 16:13, Warren Frame notifications@github.com wrote:
Awesome! Looks good from here - will try to merge this in tonight
Side note! there's no real governance model in place, but essentially if someone adds a file here, I sort of assume they have ownership over it and will tag them if folks open related issues/PRs (until they tell me not to : P)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RamblingCookieMonster/BuildHelpers/pull/62#issuecomment-390239032, or mute the thread https://github.com/notifications/unsubscribe-auth/AGZUFF0hMnDy-CtoQOnatSUyst2oqgD4ks5tzuUZgaJpZM4T93js .
Looks good to me. The aspercentage makes sense.
Thanks for adding this so I can start adding this to our builds.
Awesome, thanks @markwragg @Midacts : ) merged!
Per this blog post:
This PR is to introduce a
Set-CodeCoverageBadge
function which can be used to update a code coverage badge on your readme.md with the current code coverage percentage result and an associated colour. Example usage in your build pipeline:I've also added a basic Pester test for this new function.