-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (51 loc) · 1.75 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Coverage
on:
pull_request:
push:
branches:
- main
jobs:
coverage:
if: github.actor != 'dependabot[bot]' || github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
deployments: write
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run tests and generate coverage report
run: ./gradlew koverXmlReport
- name: Add coverage report to PR
id: kover
uses: mi-kas/kover-report@v1
with:
path: |
${{ github.workspace }}/chat-android/build/reports/kover/report.xml
title: Code Coverage
update-comment: true
min-coverage-overall: 80
coverage-counter-type: LINE
- name: Create coverage stats
run: |
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