Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/replay-compose-ui-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Replay Compose UI Matrix'
on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
replay-compose-ui-matrix:
name: Replay Compose UI Matrix
runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Setup Java Version
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
distribution: 'temurin'
java-version: '21'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1

- name: Run Replay Tests Against Each Compose UI Version
run: ./gradlew :sentry-android-replay:testComposeUiMatrix -PcomposeUiTestMatrix

- name: Upload test results
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: test-results-replay-compose-ui-matrix
path: |
sentry-android-replay/build/reports/*

- name: Test Report
uses: phoenix-actions/test-reporting@7317eea6e13c47348dd0bb318669485157c518d6 # pin@v16
if: always()
with:
name: JUnit Replay Compose UI Matrix
list-suites: 'failed'
list-tests: 'failed'
path: |
sentry-android-replay/build/test-results/**/*.xml
reporter: java-junit
output-to: step-summary
fail-on-error: false
20 changes: 19 additions & 1 deletion sentry-android-replay/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ plugins {

// Session Replay calls Compose internals, whose mangled JVM names change between Compose versions.
// Creating extra build types to run tests against the latest stable, and latest preview version.
val composeUiTestVersions = mapOf("composeUi112" to "1.12.1", "composeUi113" to "1.13.0-rc01")
// These are heavy Robolectric runs, so they stay out of `check` and only exist when the
// composeUiTestMatrix property is set. CI runs them in their own job:
// ./gradlew :sentry-android-replay:testComposeUiMatrix -PcomposeUiTestMatrix
val composeUiTestVersions =
if (providers.gradleProperty("composeUiTestMatrix").isPresent) {
mapOf("composeUi112" to "1.12.1", "composeUi113" to "1.13.0-rc01")
} else {
emptyMap()
}

android {
compileSdk = libs.versions.compileSdk.get().toInt()
Expand Down Expand Up @@ -127,6 +135,16 @@ composeUiTestVersions.forEach { (buildType, version) ->
}
}

if (composeUiTestVersions.isNotEmpty()) {
tasks.register("testComposeUiMatrix") {
group = "verification"
description = "Runs the unit tests against each Compose UI version in composeUiTestVersions."
dependsOn(
composeUiTestVersions.keys.map { "test${it.replaceFirstChar(Char::uppercase)}UnitTest" },
)
}
}

tasks.withType<Detekt>().configureEach {
// Target version of the generated JVM bytecode. It is used for type resolution.
jvmTarget = JavaVersion.VERSION_1_8.toString()
Expand Down
Loading