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 75d0163
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
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: |
mkdir ${{ github.workspace }}/chat-android/build/badges
echo '{"schemaVersion":1,"label":"coverage","message":"${{ steps.kover.outputs.coverage-overall }}%","color":"hsl(109, 100%, 40%)"}' > ${{ github.workspace }}/chat-android/build/badges/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: ${{ github.workspace }}/chat-android/build/badges
githubToken: ${{ secrets.GITHUB_TOKEN }}
artifactName: badges
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://img.shields.io/badge/development_status-Private_Beta-ab7df8" alt="Development status" />
<img src="https://badgen.net/github/license/3scale/saas-operator" alt="License" />
<img src="https://img.shields.io/badge/version-0.1.0--SNAPSHOT-2ea44f" alt="version: 0.1.0-SNAPSHOT" />
<a href="https://github.com/ably/ably-chat-kotlin/actions/workflows/coverage.yml"><img src="https://img.shields.io/static/v1?label=coverage&message=80%2B%25&color=2ea44f" alt="coverage - 80+%"></a>
<a href="https://github.com/ably/ably-chat-kotlin/actions/workflows/coverage.yml"><img src="https://img.shields.io/endpoint?url=https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/badges/code-coverage-badge.json" alt="coverage - 80+%"></a>
</p>

Ably Chat is a set of purpose-built APIs for a host of chat features enabling you to create 1:1, 1:Many, Many:1 and Many:Many chat rooms for
Expand Down

0 comments on commit 75d0163

Please sign in to comment.