Skip to content

Commit

Permalink
chore: add coverage badge to README
Browse files Browse the repository at this point in the history
  • Loading branch information
ttypic committed Dec 10, 2024
1 parent 14d4206 commit 5035414
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ on:

jobs:
coverage:
if: github.actor != 'dependabot[bot]' || github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
id-token: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -35,3 +41,22 @@ jobs:
update-comment: true
min-coverage-overall: 80
coverage-counter-type: LINE

- name: Create coverage stats
run: |
touch build/code-coverage-badge.json
echo '{"schemaVersion":1,"label":"coverage","message":"${{ steps.kover.outputs.coverage-overall }}%","color":"hsl(109, 100%, 40%)"}' > build/code-coverage-badge.json
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-2
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-chat-kotlin
role-session-name: "${{ github.run_id }}-${{ github.run_number }}"

- name: Upload Coverage Badge
uses: ably/sdk-upload-action@v2
with:
sourcePath: build/code-coverage-badge.json
githubToken: ${{ secrets.GITHUB_TOKEN }}
artifactName: badges

0 comments on commit 5035414

Please sign in to comment.