Skip to content

Commit

Permalink
Update Kover to 0.9.0-RC, Add Coverage Report to CI, and Consolidate …
Browse files Browse the repository at this point in the history
…Workflows (#673)

* Run codecov on PR and push

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Use codecov-action@v4 with CODECOV_TOKEN

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Remove coverage files

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Update .gitignore

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Update kover to 0.9.0-RC

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Consolidate workflows

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Update workflow to check out the repository on the correct branch and fetch all history and tags

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

* Format

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>

---------

Signed-off-by: matt-ramotar <matt.ramotar@uber.com>
  • Loading branch information
matt-ramotar authored Nov 24, 2024
1 parent 56a06d0 commit bd0ce82
Show file tree
Hide file tree
Showing 16 changed files with 116 additions and 14,675 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coverage:
range: 50..80
range: 70..80
round: down
precision: 2

Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/.ci_test_and_publish.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/check.yml

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
api-level:
- 29
steps:

- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref || github.ref }}
fetch-depth: 0
persist-credentials: false

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Build and Test with Coverage
run: ./gradlew clean build koverXmlReport --stacktrace

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: build/reports/kover/coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true

publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'MobileNativeFoundation/Store'
runs-on: macos-latest
needs: build-and-test
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'

- name: Grant execute permission for Gradlew
run: chmod +x gradlew

- name: Upload Artifacts to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

- name: Retrieve Version
run: |
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
- name: Publish Release
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@ captures/
**/kover/html/
*.podspec
.kotlin/
yarn.lock
yarn.lock

# Ignore coverage reports
**/*/coverage.xml
**/*/build/kover/
**/*/build/reports/kover/
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ buildscript {
classpath(libs.ktlint.gradle.plugin)
classpath(libs.jacoco.gradle.plugin)
classpath(libs.maven.publish.plugin)
classpath(libs.kover.plugin)
classpath(libs.atomic.fu.gradle.plugin)
classpath(libs.kmmBridge.gradle.plugin)
classpath(libs.binary.compatibility.validator)
Expand Down
Loading

0 comments on commit bd0ce82

Please sign in to comment.