Skip to content

Commit b121ae5

Browse files
[ConfigSample] Try out caching
1 parent d20a9b7 commit b121ae5

File tree

3 files changed

+17
-52
lines changed

3 files changed

+17
-52
lines changed

.github/workflows/TestConfigurationSample.yaml

+16-16
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747

4848
gradleManagedVirtualDevicesTest:
4949
needs: build
50-
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
51-
timeout-minutes: 90
50+
runs-on: macos-latest
51+
timeout-minutes: 30
5252

5353
steps:
5454
- name: Checkout
@@ -62,7 +62,7 @@ jobs:
6262
with:
6363
java-version: 11
6464

65-
- name: Generate cache key
65+
- name: Generate cache key for Gradle cache
6666
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
6767

6868
- uses: actions/cache@v2
@@ -73,25 +73,25 @@ jobs:
7373
~/.gradle/caches/build-cache-*
7474
key: gradle-${{ hashFiles('checksum.txt') }}
7575

76-
- name: AVD cache
76+
- name: Cache pixel2api29 system image
7777
uses: actions/cache@v2
78-
id: avd-cache
7978
with:
8079
path: |
81-
~/.android/gradle/avd/*
82-
key: avd
80+
~/.android/gradle/avd/dev29_aosp_x86_Pixel_2.ini
81+
~/.android/gradle/avd/dev29_aosp_x86_Pixel_2.avd
82+
key: pixel2api29
8383

8484
- name: Run all tests
8585
working-directory: ${{ env.SAMPLE_PATH }}
86-
run: ./gradlew -i pixel2api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen
87-
88-
- name: Run regression tests
89-
working-directory: ${{ env.SAMPLE_PATH }}
90-
run: ./gradlew -i pixel2api26DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceApi26
91-
92-
- name: Run large screen tests
93-
working-directory: ${{ env.SAMPLE_PATH }}
94-
run: ./gradlew -i nexus9api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen
86+
run: ./gradlew pixel2api29DebugAndroidTest
87+
88+
# - name: Run regression tests
89+
# working-directory: ${{ env.SAMPLE_PATH }}
90+
# run: ./gradlew -i pixel2api26DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceApi26
91+
#
92+
# - name: Run large screen tests
93+
# working-directory: ${{ env.SAMPLE_PATH }}
94+
# run: ./gradlew -i nexus9api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen
9595

9696
- name: Upload test reports
9797
if: always()

TestConfigurationSample/app/src/androidTest/java/com/example/android/testing/testconfigurationsample/MainActivityLargeScreenTests.kt

-34
This file was deleted.

TestConfigurationSample/app/src/androidTest/java/com/example/android/testing/testconfigurationsample/MainActivityTests.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import androidx.compose.ui.test.junit4.createAndroidComposeRule
1919
import androidx.test.ext.junit.runners.AndroidJUnit4
2020
import kotlinx.coroutines.delay
2121
import kotlinx.coroutines.runBlocking
22-
import org.junit.Assert
2322
import org.junit.Assert.assertTrue
2423
import org.junit.Rule
2524
import org.junit.Test
@@ -70,6 +69,6 @@ class MainActivityTests {
7069
fun regressionTestKnownIssueApi26() {
7170
// Add instrumented tests here
7271
runBlocking { delay(10000) }
73-
Assert.assertTrue(true)
72+
assertTrue(true)
7473
}
7574
}

0 commit comments

Comments
 (0)