johanvanhelden / gha-clover-test-coverage-check Goto Github PK
View Code? Open in Web Editor NEWA clover coverage checker
License: MIT License
A clover coverage checker
License: MIT License
Ideally I would like to have some sort of automatic testing set up. Since it's quite time consuming to test this action manually ๐ค
Originally posted by @johanvanhelden in #4 (comment)
Hi!
Since the upgrade to using $GITHUB_OUTPUT
rather than set-output
, the outputs from this action have been empty.
At first I thought it may be because of the ##
infront of the echo "coverage=50%" >> $GITHUB_OUTPUT
, but I changed that and tested it with no luck.
I saw someone else also had this issue, any ideas how to go about fixing this?
> > No warnings anymore, but I have empty value while trying to access coverage and other values
${{ steps.coverage.outputs.coverage }}
it is now stored in
$GITHUB_OUTPUT
echo "${{ env.steps.coverage.outputs.coverage }}" # This will output the coverage
It doesn't work for me as well :(
Also in docs I found that env.
should not be used for getting output step value https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-3
But the weird thing they propose to use (and it works for me)
echo "SELECTED_COLOR=green" >> $GITHUB_OUTPUT
But in action logs I see output with ##
symbols:
##"coverage=99.438202247191" >> $GITHUB_OUTPUT
Originally posted by @pfy-oleksii-storozhylov in #10 (comment)
Allow the user to get a different metric than just elements
. For example:
statements
conditionals
methods
Maybe adding a field for selecting that and then using it at PHP like:
$metricName = $argv[3] || 'elements';
# (...)
foreach ($metrics as $metric) {
$totalElements += (int) $metric[$metricName];
$checkedElements += (int) $metric['covered' . $metricName];
}
Hello again!
It would be nice to tell to the action a maximum number of decimals to show in an output value. Now, I have to add an extra action to round it, when it will be often needed. I think an extra output value its better than the original one, as rounding up may loose desired precision:
$precision = (int) $argv[3];
# [...]
echo '##[set-output name=round;]' . round($coverage, $precision) . PHP_EOL;
And then, in action.yml
:
inputs:
#[...]
precision:
description: "The precision of the rounded value."
required: true
default: "2"
#[...]
outputs:
#[...]
round:
description: 'The processed value from the XML file, rounded to `precision` decimals.'
#[...]
args:
- ${{ inputs.filename }}
- ${{ inputs.percentage }}
- ${{ inputs.precision }}
Hi, this seems like a great library I'd like to consider using.
Please clarify the license terms?
Adding a LICENSE.txt
would be nice as well.
Hello!
It would be great to access the calculated value as an aoutput value os the action. It just needs to echo
in a fancy way, something like:
echo '##[set-output name=elements;]' . $coverage . PHP_EOL;
Then, this number can be used from next actions, with something like:
- name: Check test coverage
uses: johanvanhelden/gha-clover-test-coverage-check@v1
id: coverage
with:
percentage: "95"
filename: "coverage.xml"
# Use the output from the `coverage` step
- name: Generate the badge SVG image
uses: emibcn/badge-action@v1
id: badge
with:
label: 'Coverage'
status: ${{ steps.coverage.outputs.elements }}
color: ${{ steps.coverage.outputs.elements > 95 && 'green' || 'red' }}
path: ./badges/test-coverage.svg
First of all, thanks for the great workflow! I got a deprecation warning when using it related to this: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
I think the change in helpers/Output
would be fairly minimal and I'd be happy to file a PR if you would be open to that. Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.