From 251bb4dbfcb6b528bc0084e2740d7ff78e5736bf Mon Sep 17 00:00:00 2001 From: Carter Jernigan Date: Wed, 31 Aug 2022 11:17:47 -0400 Subject: [PATCH] [#697] Fix running robo test (#698) --- .github/workflows/pull-request.yml | 5 ++++- build.gradle.kts | 8 +++---- demo-app/build.gradle.kts | 35 ++++++++++++++++++++++++++---- gradle.properties | 7 +++++- 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4e09e985..19b56229 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -163,6 +163,7 @@ jobs: run: | ./gradlew :sdk-lib:lintRelease :demo-app:lintZcashmainnetRelease - name: Collect Artifacts + if: ${{ always() }} timeout-minutes: 1 env: ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }} @@ -171,6 +172,7 @@ jobs: mkdir ${ARTIFACTS_DIR_PATH} zip -r ${LINT_ZIP_PATH} . -i \*build/reports/\* - name: Upload Artifacts + if: ${{ always() }} uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 timeout-minutes: 1 with: @@ -361,6 +363,7 @@ jobs: permissions: packages: read contents: read + id-token: write steps: - name: Checkout timeout-minutes: 1 @@ -381,7 +384,7 @@ jobs: - name: Download a single artifact uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 with: - name: Release binaries + name: Demo app release binaries - name: Robo test timeout-minutes: 15 env: diff --git a/build.gradle.kts b/build.gradle.kts index 6f51cbe9..d35f6463 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -60,10 +60,10 @@ fladle { // Firebase Test Lab has min and max values that might differ from our project's // These are determined by `gcloud firebase test android models list` @Suppress("MagicNumber", "PropertyName", "VariableNaming") - val FIREBASE_TEST_LAB_MIN_API = 23 + val FIREBASE_TEST_LAB_MIN_API = 19 @Suppress("MagicNumber", "PropertyName", "VariableNaming") - val FIREBASE_TEST_LAB_MAX_API = 30 + val FIREBASE_TEST_LAB_MAX_API = 33 val minSdkVersion = run { val buildMinSdk = project.properties["ANDROID_MIN_SDK_VERSION"].toString().toInt() @@ -84,8 +84,8 @@ fladle { } devices.addAll( - mapOf("model" to "Pixel2", "version" to minSdkVersion), - mapOf("model" to "Pixel2", "version" to targetSdkVersion) + mapOf("model" to "Nexus5", "version" to minSdkVersion), + mapOf("model" to "Pixel2.arm", "version" to targetSdkVersion) ) @Suppress("MagicNumber") diff --git a/demo-app/build.gradle.kts b/demo-app/build.gradle.kts index 0a3e795c..6914ddd5 100644 --- a/demo-app/build.gradle.kts +++ b/demo-app/build.gradle.kts @@ -20,6 +20,30 @@ android { viewBinding = true } + val releaseKeystorePath = project.property("ZCASH_RELEASE_KEYSTORE_PATH").toString() + val releaseKeystorePassword = project.property("ZCASH_RELEASE_KEYSTORE_PASSWORD").toString() + val releaseKeyAlias = project.property("ZCASH_RELEASE_KEY_ALIAS").toString() + val releaseKeyAliasPassword = + project.property("ZCASH_RELEASE_KEY_ALIAS_PASSWORD").toString() + val isReleaseSigningConfigured = listOf( + releaseKeystorePath, + releaseKeystorePassword, + releaseKeyAlias, + releaseKeyAliasPassword + ).all { it.isNotBlank() } + + signingConfigs { + if (isReleaseSigningConfigured) { + // If this block doesn't execute, the output will be unsigned + create("release").apply { + storeFile = File(releaseKeystorePath) + storePassword = releaseKeystorePassword + keyAlias = releaseKeyAlias + keyPassword = releaseKeyAliasPassword + } + } + } + flavorDimensions.add("network") productFlavors { @@ -46,6 +70,9 @@ android { File("proguard-project.txt") ) ) + if (isReleaseSigningConfigured) { + signingConfig = signingConfigs.getByName("release") + } } } @@ -78,10 +105,10 @@ fladle { // Firebase Test Lab has min and max values that might differ from our project's // These are determined by `gcloud firebase test android models list` @Suppress("MagicNumber", "PropertyName", "VariableNaming") - val FIREBASE_TEST_LAB_MIN_API = 23 + val FIREBASE_TEST_LAB_MIN_API = 19 @Suppress("MagicNumber", "PropertyName", "VariableNaming") - val FIREBASE_TEST_LAB_MAX_API = 30 + val FIREBASE_TEST_LAB_MAX_API = 33 val minSdkVersion = run { val buildMinSdk = @@ -116,8 +143,8 @@ fladle { testTimeout.set("5m") devices.addAll( - mapOf("model" to "Pixel2", "version" to minSdkVersion), - mapOf("model" to "Pixel2", "version" to targetSdkVersion) + mapOf("model" to "Nexus5", "version" to minSdkVersion), + mapOf("model" to "Pixel2.arm", "version" to targetSdkVersion) ) flankVersion.set(libs.versions.flank.get()) diff --git a/gradle.properties b/gradle.properties index 3afd162b..384637d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -52,11 +52,16 @@ IS_MINIFY_APP_ENABLED=true # are overridden via ~/.gradle/gradle.properties to allow secure injection. # Debug keystore is useful if using Google Maps or Firebase, which require API keys to be linked # to a signing key. Without a debug keystore, the default Android debug keystore will be used. +# Without a release signing configuration, the release output will not be signed. ZCASH_DEBUG_KEYSTORE_PATH= +ZCASH_RELEASE_KEYSTORE_PATH= +ZCASH_RELEASE_KEYSTORE_PASSWORD= +ZCASH_RELEASE_KEY_ALIAS= +ZCASH_RELEASE_KEY_ALIAS_PASSWORD= # Versions ANDROID_MIN_SDK_VERSION=19 -ANDROID_TARGET_SDK_VERSION=31 +ANDROID_TARGET_SDK_VERSION=33 ANDROID_COMPILE_SDK_VERSION=33 # TODO[#317]: https://github.com/zcash/zcash-android-wallet-sdk/issues/317