Skip to content

Commit

Permalink
Report coverage percentage.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Feb 29, 2024
1 parent e6a31b2 commit 1f52888
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ env:
jobs:
coverage:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v2
Expand Down Expand Up @@ -38,4 +40,18 @@ jobs:
cat diff.json | jq '.newEndpoints | group_by(.pathUrl)[] | .[0].pathUrl + ": " + (map(.method) | tostring)' --raw-output
echo "-------- Legacy APIs"
cat diff.json | jq '.missingEndpoints | group_by(.pathUrl)[] | .[0].pathUrl + ": " + (map(.method) | tostring)' --raw-output
- name: Gather Coverage
id: coverage
shell: bash
run: |
echo "current=`cat OpenSearch.openapi.json | jq '.paths | keys[]' | wc -l`" >> $GITHUB_OUTPUT
echo "total=`cat OpenSearch.auto.openapi.json | jq '.paths | keys[]' | wc -l`" >> $GITHUB_OUTPUT
echo "percent=`$(${{ steps.coverage.outputs.current }}*100/${{ steps.coverage.outputs.total }})`" >> $GITHUB_OUTPUT
- name: Report Coverage
shell: bash
run: |
echo API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} $(${{ steps.coverage.outputs.percent }}%) APIs.
- uses: mshick/add-pr-comment@v2
with:
message: |
API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} $(${{ steps.coverage.outputs.percent }}%) APIs.

0 comments on commit 1f52888

Please sign in to comment.