-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (36 loc) · 1.15 KB
/
coverage-badge.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
# coverage-badge.yml
name: Create coverage badge
on:
push:
branches: [ main ] # !! CONFIRM THIS !!
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Java 11 needed for resolving the Android Gradle Plugin
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Cache Kotlin Native compiler
uses: actions/cache@v3
with:
path: ~/.konan
key: kotlin-native-compiler-${{ runner.OS }}
- name: Generate coverage output
run: |
echo "COVERAGE=$(${{github.workspace}}/gradlew -q printLineCoverage)" >> $GITHUB_ENV
- name: Update dynamic badge gist
uses: schneegans/[email protected]
with:
auth: ${{secrets.COVERAGE_GIST_SECRET}}
gistID: 01b6bfe88483946d9f5438f5616d9b9f
filename: truthish-coverage-badge.json
label: coverage
message: ${{env.COVERAGE}}%
valColorRange: ${{env.COVERAGE}}
minColorRange: 0
maxColorRange: 100