Skip to content

Commit bd0ce82

Browse files
authored
Update Kover to 0.9.0-RC, Add Coverage Report to CI, and Consolidate Workflows (#673)
* Run codecov on PR and push Signed-off-by: matt-ramotar <[email protected]> * Use codecov-action@v4 with CODECOV_TOKEN Signed-off-by: matt-ramotar <[email protected]> * Remove coverage files Signed-off-by: matt-ramotar <[email protected]> * Update .gitignore Signed-off-by: matt-ramotar <[email protected]> * Update kover to 0.9.0-RC Signed-off-by: matt-ramotar <[email protected]> * Consolidate workflows Signed-off-by: matt-ramotar <[email protected]> * Update workflow to check out the repository on the correct branch and fetch all history and tags Signed-off-by: matt-ramotar <[email protected]> * Format Signed-off-by: matt-ramotar <[email protected]> --------- Signed-off-by: matt-ramotar <[email protected]>
1 parent 56a06d0 commit bd0ce82

File tree

16 files changed

+116
-14675
lines changed

16 files changed

+116
-14675
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
coverage:
2-
range: 50..80
2+
range: 70..80
33
round: down
44
precision: 2
55

.github/workflows/.ci_test_and_publish.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 30
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
api-level:
19+
- 29
20+
steps:
21+
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
with:
25+
ref: ${{ github.head_ref || github.ref }}
26+
fetch-depth: 0
27+
persist-credentials: false
28+
29+
- name: Set up JDK 11
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: 'zulu'
33+
java-version: '11'
34+
35+
- name: Setup Gradle
36+
uses: gradle/gradle-build-action@v2
37+
38+
- name: Grant execute permission for Gradlew
39+
run: chmod +x gradlew
40+
41+
- name: Build and Test with Coverage
42+
run: ./gradlew clean build koverXmlReport --stacktrace
43+
44+
- name: Upload Coverage to Codecov
45+
uses: codecov/codecov-action@v4
46+
with:
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
files: build/reports/kover/coverage.xml
49+
flags: unittests
50+
name: codecov-umbrella
51+
fail_ci_if_error: true
52+
verbose: true
53+
54+
publish:
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'MobileNativeFoundation/Store'
56+
runs-on: macos-latest
57+
needs: build-and-test
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
62+
- name: Set up JDK 11
63+
uses: actions/setup-java@v4
64+
with:
65+
distribution: 'zulu'
66+
java-version: '11'
67+
68+
- name: Grant execute permission for Gradlew
69+
run: chmod +x gradlew
70+
71+
- name: Upload Artifacts to Maven Central
72+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
73+
env:
74+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
75+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
76+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
77+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
78+
79+
- name: Retrieve Version
80+
run: |
81+
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
82+
83+
- name: Publish Release
84+
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
85+
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
86+
env:
87+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
88+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,9 @@ captures/
5050
**/kover/html/
5151
*.podspec
5252
.kotlin/
53-
yarn.lock
53+
yarn.lock
54+
55+
# Ignore coverage reports
56+
**/*/coverage.xml
57+
**/*/build/kover/
58+
**/*/build/reports/kover/

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ buildscript {
1818
classpath(libs.ktlint.gradle.plugin)
1919
classpath(libs.jacoco.gradle.plugin)
2020
classpath(libs.maven.publish.plugin)
21-
classpath(libs.kover.plugin)
2221
classpath(libs.atomic.fu.gradle.plugin)
2322
classpath(libs.kmmBridge.gradle.plugin)
2423
classpath(libs.binary.compatibility.validator)

0 commit comments

Comments
 (0)