Skip to content

Commit

Permalink
ci(android): run gradle plugin tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaysood committed Jan 20, 2024
1 parent 36d7a51 commit 6c3261b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
permissions:
contents: read
packages: write
timeout-minutes: 10
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
Expand All @@ -59,6 +59,13 @@ jobs:
- name: Publish measure-android
run: ./gradlew clean :measure:publish --no-daemon --no-parallel --no-configuration-cache --stacktrace

# Certain gradle plugin tests depend on the measure-android artifact being published. We run all the tests for
# measure-android-gradle here to ensure everything works.
- name: Run measure-android-gradle tests
run: ./gradlew clean :measure-gradle-plugin:test --no-daemon --no-parallel --no-configuration-cache --stacktrace
- name: Run measure-android-gradle functional tests
run: ./gradlew clean :measure-gradle-plugin:functionalTest --no-daemon --no-parallel --no-configuration-cache --stacktrace

publish-android-gradle:
runs-on: ubuntu-latest
needs: [ checks ]
Expand All @@ -69,7 +76,7 @@ jobs:
permissions:
contents: read
packages: write
timeout-minutes: 10
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
Expand All @@ -78,5 +85,9 @@ jobs:
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Run measure-android-gradle tests
run: ./gradlew clean :measure-gradle-plugin:test --no-daemon --no-parallel --no-configuration-cache --stacktrace
- name: Run measure-android-gradle functional tests
run: ./gradlew clean :measure-gradle-plugin:functionalTest --no-daemon --no-parallel --no-configuration-cache --stacktrace
- name: Publish measure-android-gradle
run: ./gradlew clean :measure-gradle-plugin:publishMavenPublicationToGitHubPackagesRepository --no-daemon --no-parallel --no-configuration-cache --stacktrace
2 changes: 1 addition & 1 deletion measure-android/measure-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dependencies {
testImplementation("org.ow2.asm:asm-util:9.6")
testImplementation("org.ow2.asm:asm-commons:9.6")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
testImplementationAar("sh.measure:android:0.0.1-SNAPSHOT")
testImplementationAar("sh.measure:measure-android:0.1.0")

functionalTestRuntimeOnly("org.junit.platform:junit-platform-launcher")
functionalTestImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
Expand Down
9 changes: 8 additions & 1 deletion measure-android/measure-gradle-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ dependencyResolutionManagement {
google()
mavenCentral()
mavenLocal()
maven {
url = uri("https://maven.pkg.github.com/measure-sh/measure")
credentials {
username = extra.properties["gpr.user"] as String? ?: System.getenv("GITHUB_ACTOR")
password = extra.properties["gpr.key"] as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
}

rootProject.name = "measure-gradle-plugin"
rootProject.name = "measure-android-gradle"

0 comments on commit 6c3261b

Please sign in to comment.