Skip to content

Commit

Permalink
Updates to AGP alpha, gradle and adds GMD in GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAlcerreca committed Mar 22, 2022
1 parent e1cad44 commit cb51478
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 3 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/blueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,70 @@ jobs:
with:
name: test-reports
path: app/build/reports/


gradleManagedVirtualDevicesTest:
needs: build
runs-on: macos-latest
timeout-minutes: 30

steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

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

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

- name: Cache pixel2api30 system image
uses: actions/cache@v2
with:
path: |
~/.android/gradle/avd/dev30_aosp-atd_x86_Pixel_2.avd.*
key: pixel2api30

- name: Cache pixel2api27 system image
uses: actions/cache@v2
with:
path: ~/.android/gradle/avd/dev27_aosp_x86_Pixel_2.*
key: pixel2api27

- name: Cache nexus9api29 system image
uses: actions/cache@v2
with:
path: ~/.android/gradle/avd/dev29_aosp_x86_Nexus_9.*
key: nexus9api29

# - name: Run all tests pixel 2 api 27 ATD
# working-directory: ${{ env.SAMPLE_PATH }}
# run: ./gradlew pixel2api27atdMockDebugAndroidTest
#
# - name: Run all tests nexus 9 api 29 ATD
# working-directory: ${{ env.SAMPLE_PATH }}
# run: ./gradlew nexus9api29atdMockDebugAndroidTest

- name: Run all tests pixel 2 api 30 ATD
working-directory: ${{ env.SAMPLE_PATH }}
run: ./gradlew pixel2api30atdMockDebugAndroidTest

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
path: ${{ env.SAMPLE_PATH }}/app/build/reports/androidTests/managedDevice/
25 changes: 25 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,31 @@ android {
composeOptions {
kotlinCompilerExtensionVersion "$composeVersion"
}

testOptions {
devices {
pixel2api30atd(com.android.build.api.dsl.ManagedVirtualDevice) {
// Use device profiles you typically see in Android Studio
device = "Pixel 2"
apiLevel = 30
// You can also specify "google" if you require Google Play Services.
systemImageSource = "aosp-atd"
abi = "x86"
}
pixel2api27atd(com.android.build.api.dsl.ManagedVirtualDevice) {
device = "Pixel 2"
apiLevel = 27
systemImageSource = "aosp-atd"
abi = "x86"
}
nexus9api29atd(com.android.build.api.dsl.ManagedVirtualDevice) {
device = "Nexus 9"
apiLevel = 29
systemImageSource = "aosp-atd"
abi = "x86"
}
}
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:7.3.0-alpha07'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Feb 18 13:22:47 CET 2022
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit cb51478

Please sign in to comment.