Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to AGP alpha, gradle and adds GMD in GHA #829

Open
wants to merge 28 commits into
base: dev-compose
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cb51478
Updates to AGP alpha, gradle and adds GMD in GHA
JoseAlcerreca Mar 22, 2022
a0f3cf4
Disabled checksum for now
JoseAlcerreca Mar 22, 2022
096a3d0
Adds canary channel for atd
JoseAlcerreca Mar 22, 2022
7afb493
Adds android-actions/setup-android to GHA to accept licenses
JoseAlcerreca Mar 22, 2022
dbe3f7e
GHA failed, trying fewer shards
JoseAlcerreca Mar 22, 2022
68387cc
Added swiftshader_indirect
JoseAlcerreca Mar 23, 2022
19dbb39
Adds job to upload all emulator logs. One test fails.
JoseAlcerreca Mar 23, 2022
236715b
Moves tests to main build job
JoseAlcerreca Mar 23, 2022
7158f25
Fix paths in CI
JoseAlcerreca Mar 23, 2022
f58aa71
Trying to fix paths again
JoseAlcerreca Mar 23, 2022
80ffa63
Not sure what's up with reports
JoseAlcerreca Mar 23, 2022
d19d6f8
Trying again, paths are different for some reason
JoseAlcerreca Mar 23, 2022
d0e9236
Adds emulator logs
JoseAlcerreca Mar 23, 2022
a696add
dropping numshards to 1
JoseAlcerreca Mar 23, 2022
f23c91b
Move GHA to macos-latest
JoseAlcerreca Mar 23, 2022
9244023
GHA down, re-run
JoseAlcerreca Mar 23, 2022
d2cb370
Benchmark robolectric tests
JoseAlcerreca Mar 24, 2022
67daf09
Pre-compile unit tests before running
JoseAlcerreca Mar 24, 2022
778f684
Shards back to 2
JoseAlcerreca Mar 24, 2022
c6c8fe4
Trying on ubuntu with single shard
JoseAlcerreca Mar 24, 2022
08da1c3
gha rerun
JoseAlcerreca Mar 24, 2022
36fe9a8
Reenable regular emulator tests
JoseAlcerreca Mar 24, 2022
24d30cc
Proper setup of GMD devices (no atd <30)
JoseAlcerreca Mar 24, 2022
3d0ada0
back to mac
JoseAlcerreca Mar 24, 2022
82cea8e
Adds compile androidtest step
JoseAlcerreca Mar 25, 2022
21bd36f
Now fixing instr tests, moving to x86_64
JoseAlcerreca Mar 25, 2022
9dcad01
Adds non-atd run
JoseAlcerreca Mar 25, 2022
e512cb6
Adds ATD to non-GMD runs
JoseAlcerreca Mar 25, 2022
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
173 changes: 145 additions & 28 deletions .github/workflows/blueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
runs-on: macos-latest
timeout-minutes: 45

steps:
- name: Checkout
Expand All @@ -33,47 +33,164 @@ jobs:
~/.gradle/caches/build-cache-*
key: gradle-${{ hashFiles('checksum.txt') }}

- name: Build project
- name: Build project Mock and UnitTest
run: ./gradlew assembleMockDebug assembleProdDebug compileMockDebugUnitTestKotlin

- name: Spotless
run: ./gradlew spotlessCheck

- name: Robolectric Mock
run: ./gradlew testMockDebugUnitTest

- name: Build project Prod and UnitTest
run: ./gradlew assembleMockDebug assembleProdDebug compileProdDebugUnitTestKotlin

- name: Robolectric Prod
run: ./gradlew spotlessCheck assembleMockDebug assembleProdDebug testMockDebugUnitTest testProdDebugUnitTest --stacktrace

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v2
with:
name: build-reports
path: app/build/reports/
# test:
# needs: build
# runs-on: macOS-latest # enables hardware acceleration in the virtual machine
# timeout-minutes: 30
# strategy:
# matrix:
# api-level: [23, 29]
#
# 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
#

test:
needs: build
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
timeout-minutes: 30
strategy:
matrix:
api-level: [23, 29]
#
# - name: Upload test reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: test-reports
# path: app/build/reports/

steps:
- name: Checkout
uses: actions/checkout@v2
#
# 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: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
# Needed to accept licenses
- name: Setup Android SDK
uses: android-actions/setup-android@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
# - 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: Compile AndroidTests Mock
run: ./gradlew compileMockDebugAndroidTestKotlin

- name: Run all tests pixel 2 api 30 ATD
working-directory: .
run: ./gradlew -Pandroid.sdk.channel=3 -Pandroid.experimental.androidTest.numManagedDeviceShards=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" pixel2api30atdMockDebugAndroidTest

- name: Run all tests pixel 2 api 30 ATD again
working-directory: .
run: ./gradlew -Pandroid.sdk.channel=3 -Pandroid.experimental.androidTest.numManagedDeviceShards=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" pixel2api30atdMockDebugAndroidTest

- name: Run all tests pixel 2 api 30 non-atd
working-directory: .
run: ./gradlew -Pandroid.sdk.channel=3 -Pandroid.experimental.androidTest.numManagedDeviceShards=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" pixel2api30MockDebugAndroidTest

- name: Run all tests pixel 2 api 30 non-atd again
working-directory: .
run: ./gradlew -Pandroid.sdk.channel=3 -Pandroid.experimental.androidTest.numManagedDeviceShards=1 -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect" pixel2api30MockDebugAndroidTest

- name: Run instrumentation tests API 30
uses: reactivecircus/android-emulator-runner@v2
with:
java-version: 11
api-level: 30
arch: x86_64
disable-animations: true
script: ./gradlew app:cMDAT --stacktrace

- name: Run instrumentation tests
- name: Run instrumentation tests API 30 ATD
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
api-level: 30
arch: x86
channel: canary
target: aosp_atd
disable-animations: true
script: ./gradlew app:cMDAT --stacktrace

- name: Upload test reports
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-reports
name: build-reports
path: app/build/reports/

- name: Upload all outputs
if: failure()
uses: actions/upload-artifact@v2
with:
name: outputs
path: app/build/outputs/

# - name: Upload test reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: test-reports
# path: ./app/build/reports/androidTests/managedDevice/
33 changes: 33 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,39 @@ 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"
}
pixel2api30(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"
abi = "x86"
}
pixel2api27(com.android.build.api.dsl.ManagedVirtualDevice) {
device = "Pixel 2"
apiLevel = 27
systemImageSource = "aosp"
abi = "x86"
}
nexus9api29(com.android.build.api.dsl.ManagedVirtualDevice) {
device = "Nexus 9"
apiLevel = 29
systemImageSource = "aosp"
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