Skip to content

Commit e2738ad

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

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ 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+
deployments: write
15+
id-token: write
16+
contents: read
1217
steps:
1318
- name: Checkout code
1419
uses: actions/checkout@v4
@@ -35,3 +40,21 @@ jobs:
3540
update-comment: true
3641
min-coverage-overall: 80
3742
coverage-counter-type: LINE
43+
44+
- name: Create coverage stats
45+
run: |
46+
echo '{"schemaVersion":1,"label":"coverage","message":"${{ steps.kover.outputs.coverage-overall }}%","color":"hsl(109, 100%, 40%)"}' > build/code-coverage-badge.json
47+
48+
- name: Configure AWS Credentials
49+
uses: aws-actions/configure-aws-credentials@v4
50+
with:
51+
aws-region: eu-west-2
52+
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/ably-sdk-builds-ably-chat-kotlin
53+
role-session-name: "${{ github.run_id }}-${{ github.run_number }}"
54+
55+
- name: Upload Coverage Badge
56+
uses: ably/sdk-upload-action@v2
57+
with:
58+
sourcePath: build/code-coverage-badge.json
59+
githubToken: ${{ secrets.GITHUB_TOKEN }}
60+
artifactName: badges

0 commit comments

Comments
 (0)