Skip to content

Commit eafd9d4

Browse files
committed
chore: add coverage badge to README
1 parent 14d4206 commit eafd9d4

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ on:
88

99
jobs:
1010
coverage:
11+
if: github.actor != 'dependabot[bot]' || github.event_name != 'pull_request'
1112
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
deployments: write
16+
id-token: write
17+
pull-requests: write
1218
steps:
1319
- name: Checkout code
1420
uses: actions/checkout@v4
@@ -35,3 +41,22 @@ jobs:
3541
update-comment: true
3642
min-coverage-overall: 80
3743
coverage-counter-type: LINE
44+
45+
- name: Create coverage stats
46+
run: |
47+
mkdir ${{ github.workspace }}/chat-android/build/badges
48+
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
49+
50+
- name: Configure AWS Credentials
51+
uses: aws-actions/configure-aws-credentials@v4
52+
with:
53+
aws-region: eu-west-2
54+
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-chat-kotlin
55+
role-session-name: "${{ github.run_id }}-${{ github.run_number }}"
56+
57+
- name: Upload Coverage Badge
58+
uses: ably/sdk-upload-action@v2
59+
with:
60+
sourcePath: ${{ github.workspace }}/chat-android/build/badges
61+
githubToken: ${{ secrets.GITHUB_TOKEN }}
62+
artifactName: badges

0 commit comments

Comments
 (0)