[#882] Check properties on CI

Co-authored-by: Honza <rychnovsky.honza@gmail.com>
This commit is contained in:
Carter Jernigan 2023-01-25 15:10:05 -05:00 committed by GitHub
parent 17018422fa
commit f0a00f6771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 0 deletions

View File

@ -74,6 +74,24 @@ jobs:
if: "${{ env.EMULATOR_WTF_API_KEY != '' }}"
run: echo "defined=true" >> $GITHUB_OUTPUT
check_properties:
needs: prime_cache
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
timeout-minutes: 1
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- name: Setup
id: setup
timeout-minutes: 5
uses: ./.github/actions/setup
- name: Check properties
timeout-minutes: 4
run: |
./gradlew checkProperties
static_analysis_detekt:
needs: prime_cache
runs-on: ubuntu-latest

View File

@ -46,6 +46,48 @@ tasks {
}
}
}
register("checkProperties") {
doLast {
// Ensure that developers do not change default values of certain properties directly in the repo, but
// instead set them in their local ~/.gradle/gradle.properties file (or use command line arguments)
val expectedPropertyValues = mapOf(
"ZCASH_MAVEN_PUBLISH_USERNAME" to "",
"ZCASH_MAVEN_PUBLISH_PASSWORD" to "",
"ZCASH_ASCII_GPG_KEY" to "",
"IS_SNAPSHOT" to "true",
"ZCASH_IS_TREAT_WARNINGS_AS_ERRORS" to "true",
"IS_USE_TEST_ORCHESTRATOR" to "false",
"ZCASH_FIREBASE_TEST_LAB_API_KEY_PATH" to "",
"ZCASH_FIREBASE_TEST_LAB_PROJECT" to "",
"ZCASH_EMULATOR_WTF_API_KEY" to "",
"IS_MINIFY_SDK_ENABLED" to "false",
"IS_MINIFY_APP_ENABLED" to "true",
"ZCASH_DEBUG_KEYSTORE_PATH" to "",
"ZCASH_RELEASE_KEYSTORE_PATH" to "",
"ZCASH_RELEASE_KEYSTORE_PASSWORD" to "",
"ZCASH_RELEASE_KEY_ALIAS" to "",
"ZCASH_RELEASE_KEY_ALIAS_PASSWORD" to "",
"IS_SIGN_RELEASE_BUILD_WITH_DEBUG_KEY" to "false",
)
val warnings = expectedPropertyValues.filter { (key, value) ->
project.properties[key].toString() != value
}.map { "Property ${it.key} does not have expected value \"${it.value}\"" }
if (warnings.isNotEmpty()) {
throw GradleException(warnings.joinToString(separator = "\n"))
}
}
}
}
val unstableKeywords = listOf("alpha", "beta", "rc", "m", "ea", "build")