Skip to content

Commit

Permalink
[ConfigSample] Try out caching
Browse files Browse the repository at this point in the history
  • Loading branch information
JolandaVerhoef committed Oct 6, 2021
1 parent d20a9b7 commit 6ed7029
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 51 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/TestConfigurationSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:

gradleManagedVirtualDevicesTest:
needs: build
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
timeout-minutes: 90
runs-on: macos-latest
timeout-minutes: 30

steps:
- name: Checkout
Expand All @@ -62,7 +62,7 @@ jobs:
with:
java-version: 11

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

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

- name: AVD cache
- name: Cache pixel2api29 system image
uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/gradle/avd/*
key: avd
~/.android/gradle/avd/dev29_aosp_x86_Pixel_2.ini
~/.android/gradle/avd/dev29_aosp_x86_Pixel_2.avd
key: pixel2api29

- name: Run all tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew -i pixel2api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen

- name: Run regression tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew -i pixel2api26DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceApi26

- name: Run large screen tests
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew -i nexus9api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen
run: ./gradlew pixel2api29DebugAndroidTest

# - name: Run regression tests
# working-directory: ${{ env.SAMPLE_PATH }}
# run: ./gradlew -i pixel2api26DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceApi26
#
# - name: Run large screen tests
# working-directory: ${{ env.SAMPLE_PATH }}
# run: ./gradlew -i nexus9api29DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.annotation=com.example.android.testing.testconfigurationsample.TestDeviceLargeScreen

- name: Upload test reports
if: always()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ class MainActivityTests {
assertTrue(true)
}

@Test
fun sampleTest5() {
// Add instrumented tests here
runBlocking { delay(10000) }
assertTrue(true)
}

/**
* When you find an issue with a specific device or API level,
* you can create an annotation for it and add it to your test.
Expand All @@ -70,6 +77,6 @@ class MainActivityTests {
fun regressionTestKnownIssueApi26() {
// Add instrumented tests here
runBlocking { delay(10000) }
Assert.assertTrue(true)
assertTrue(true)
}
}

0 comments on commit 6ed7029

Please sign in to comment.