Skip to content

Commit

Permalink
Merge branch 'google:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kul3r4 authored Apr 24, 2024
2 parents a1452b8 + 6031afc commit a5bda27
Show file tree
Hide file tree
Showing 330 changed files with 1,824 additions and 2,462 deletions.
95 changes: 74 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,42 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 40

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
lfs: 'true'

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

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

- name: Unit Tests
uses: gradle/gradle-build-action@v3
with:
arguments: testDebug -Dtest.excludeCategories=com.google.android.horologist.screenshots.rng.ScreenshotTest

- name: test-results
if: always()
uses: actions/upload-artifact@v4
with:
name: build-results
path: |
**/build/test-results/*
**/build/reports/*
**/out/*
screenshot1:
# Skip build if head commit contains 'skip ci'
if: "!contains(github.event.head_commit.message, 'skip ci')"

runs-on: ubuntu-latest
timeout-minutes: 40

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
Expand All @@ -35,39 +71,56 @@ jobs:
- name: Unit Tests
uses: gradle/gradle-build-action@v3
id: screenshotsverify
continue-on-error: true
with:
arguments: testDebug --rerun
arguments: --no-daemon verifyRoborazziDebug -x composables:verifyRoborazziDebug -x sample:verifyRoborazziDebug

- name: Prevent pushing new screenshots if this is a fork
id: checkfork
continue-on-error: false
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
run: |
echo "::error::Screenshot tests failed, please create a PR in your fork first." && exit 1
- name: screenshot-test-results-1
if: always()
uses: actions/upload-artifact@v4
with:
name: screenshot-results-1
path: |
**/build/test-results/*
**/build/reports/*
**/build/outputs/roborazzi/*
**/out/*
- name: Generate new screenshots if verification failed and it's a PR
id: screenshotsrecord
if: steps.screenshotsverify.outcome == 'failure' && github.event_name == 'pull_request'
run: |
./gradlew testDebug -P screenshot.record=repair
screenshot2:
# Skip build if head commit contains 'skip ci'
if: "!contains(github.event.head_commit.message, 'skip ci')"

- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.screenshotsrecord.outcome == 'success'
runs-on: ubuntu-latest
timeout-minutes: 40

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
file_pattern: '**/snapshots/images/*.png'
disable_globbing: true
commit_message: "🤖 Updates screenshots"
lfs: 'true'

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Upload test results and reports
- name: set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Unit Tests 2
uses: gradle/gradle-build-action@v3
id: screenshotsverify2
with:
arguments: --no-daemon composables:verifyRoborazziDebug sample:verifyRoborazziDebug

- name: screenshot-test-results-2
if: always()
uses: actions/upload-artifact@v4
with:
name: build-results
name: screenshot-results-2
path: |
**/build/test-results/*
**/build/reports/*
**/build/outputs/roborazzi/*
**/out/*
compiletests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fixup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Repair screenshots
uses: gradle/gradle-build-action@v3
with:
arguments: testDebug -P screenshot.record=repair
arguments: verifyAndRecordRoborazziDebug

- name: Push new screenshots if available
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
6 changes: 3 additions & 3 deletions ai/sample/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ dependencies {
testImplementation(libs.robolectric)

androidTestImplementation(libs.compose.ui.test.junit4)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.androidx.test.espressocore)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
}

tasks.maybeCreate("prepareKotlinIdeaImport")
.dependsOn("generateDebugProto")
// tasks.maybeCreate("prepareKotlinIdeaImport")
// .dependsOn("generateDebugProto")
2 changes: 1 addition & 1 deletion ai/sample/wear-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ dependencies {
testImplementation(libs.robolectric)

androidTestImplementation(libs.compose.ui.test.junit4)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.androidx.test.espressocore)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.truth)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.android.horologist.auth.data.googlesignin

import android.content.Context
Expand Down
4 changes: 2 additions & 2 deletions auth/sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@ dependencies {
testImplementation(libs.robolectric)
}

tasks.maybeCreate("prepareKotlinIdeaImport")
.dependsOn("generateDebugProto")
// tasks.maybeCreate("prepareKotlinIdeaImport")
// .dependsOn("generateDebugProto")
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.android.horologist.auth.sample.screens.googlesignin.signin

import androidx.lifecycle.ViewModelProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.android.horologist.auth.sample.screens.googlesignin.signout

import android.util.Log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.android.horologist.auth.ui.googlesignin.signin

import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

@file:Suppress("DEPRECATION")

package com.google.android.horologist.auth.ui.googlesignin.signin

import androidx.lifecycle.ViewModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

@file:OptIn(ExperimentalCoroutinesApi::class)
@file:Suppress("DEPRECATION")

package com.google.android.horologist.auth.ui.googlesignin.signin

Expand Down
8 changes: 0 additions & 8 deletions composables/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,3 @@ package com.google.android.horologist.composables {

}

package com.google.android.horologist.composables.picker {

public final class PickerRotaryScrollAdapterKt {
method @com.google.android.horologist.annotations.ExperimentalHorologistApi public static com.google.android.horologist.compose.rotaryinput.RotaryScrollAdapter toRotaryScrollAdapter(androidx.wear.compose.material.PickerState);
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.Button
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.PickerGroup
import androidx.wear.compose.material.PickerGroupState
import androidx.wear.compose.material.PickerState
import androidx.wear.compose.material.Text
import com.google.android.horologist.composables.picker.PickerGroup
import com.google.android.horologist.composables.picker.PickerGroupState
import com.google.android.horologist.composables.picker.PickerState
import com.google.android.horologist.composables.picker.rememberPickerGroupState
import androidx.wear.compose.material.rememberPickerGroupState
import com.google.android.horologist.compose.layout.ScreenScaffold
import java.time.LocalDate
import java.time.format.DateTimeFormatter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,16 @@ import androidx.wear.compose.foundation.ExperimentalWearFoundationApi
import androidx.wear.compose.material.Button
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.PickerGroup
import androidx.wear.compose.material.PickerGroupItem
import androidx.wear.compose.material.PickerGroupState
import androidx.wear.compose.material.PickerScope
import androidx.wear.compose.material.PickerState
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.TouchExplorationStateProvider
import com.google.android.horologist.composables.picker.PickerGroup
import com.google.android.horologist.composables.picker.PickerGroupItem
import com.google.android.horologist.composables.picker.PickerGroupState
import com.google.android.horologist.composables.picker.PickerScope
import com.google.android.horologist.composables.picker.PickerState
import com.google.android.horologist.composables.picker.rememberPickerGroupState
import com.google.android.horologist.composables.picker.rememberPickerState
import com.google.android.horologist.composables.picker.toRotaryScrollAdapter
import androidx.wear.compose.material.rememberPickerGroupState
import androidx.wear.compose.material.rememberPickerState
import com.google.android.horologist.compose.layout.ScreenScaffold
import com.google.android.horologist.compose.rotaryinput.rotaryWithSnap
import java.time.LocalTime
import java.time.temporal.ChronoField

Expand Down Expand Up @@ -297,7 +295,6 @@ public fun TimePicker(
*pickerGroupItems.toTypedArray(),
modifier = Modifier.fillMaxWidth(),
pickerGroupState = pickerGroupState,
expandToFillWidth = showSeconds,
separator = { Separator(textStyle) },
autoCenter = false,
touchExplorationStateProvider = touchExplorationStateProvider,
Expand Down Expand Up @@ -546,7 +543,6 @@ public fun TimePickerWith12HourClock(
),
modifier = Modifier.fillMaxSize(),
autoCenter = false,
expandToFillWidth = true,
pickerGroupState = pickerGroupState,
separator = {
if (it == 0) Separator(textStyle)
Expand Down Expand Up @@ -621,9 +617,7 @@ internal fun pickerGroupItemWithRSB(
): PickerGroupItem {
return PickerGroupItem(
pickerState = pickerState,
modifier = modifier.rotaryWithSnap(
pickerState.toRotaryScrollAdapter(),
),
modifier = modifier,
contentDescription = contentDescription,
onSelected = onSelected,
readOnlyLabel = readOnlyLabel,
Expand Down
Loading

0 comments on commit a5bda27

Please sign in to comment.