diff --git a/.github/workflows/run_ui_tests.yml b/.github/workflows/run_ui_tests.yml index c2e3203bbc..ed3ae1281a 100644 --- a/.github/workflows/run_ui_tests.yml +++ b/.github/workflows/run_ui_tests.yml @@ -57,6 +57,9 @@ jobs: - name: Run connectedDebugAndroidTest uses: reactivecircus/android-emulator-runner@v2 + env: + ADYEN_ANDROID_MERCHANT_SERVER_URL: 'https://android-ui-tests.adyen.com/' + ADYEN_ANDROID_CLIENT_KEY: 'test_fakefakefakefakefakefakefakefake' with: api-level: ${{ matrix.api-level }} target: google_apis diff --git a/example-app/build.gradle b/example-app/build.gradle index ecd34b8bbe..9afbcf08d8 100644 --- a/example-app/build.gradle +++ b/example-app/build.gradle @@ -17,9 +17,11 @@ apply from: "${rootDir}/config/gradle/codeQuality.gradle" if (file("local.gradle").exists()) { apply from: "local.gradle" +} else if (System.getenv("CI") == "true") { + apply from: "ci.gradle" } else if (!isIDEBuild()) { - // if not building from an IDE, use example file as it is to ensure the build passes (for CI, renovate, etc) - apply from: "example.local.gradle" + // Renovate doesn't set the CI variable, so this way we can still make sure the build succeeds. + apply from: "ci.gradle" } else { throw new GradleException("File example-app/local.gradle not found. Check example-app/README.md for more instructions.") } diff --git a/example-app/ci.gradle b/example-app/ci.gradle new file mode 100644 index 0000000000..bb2806dfbc --- /dev/null +++ b/example-app/ci.gradle @@ -0,0 +1,24 @@ +android { + buildTypes { + + def merchantAccount = System.getenv('ADYEN_ANDROID_MERCHANT_ACCOUNT') + def merchantServerUrl = System.getenv('ADYEN_ANDROID_MERCHANT_SERVER_URL') + def authorizationHeaderName = System.getenv('ADYEN_ANDROID_AUTHORIZATION_HEADER_NAME') + def authorizationHeaderValue = System.getenv('ADYEN_ANDROID_AUTHORIZATION_HEADER_VALUE') + def clientKey = System.getenv('ADYEN_ANDROID_CLIENT_KEY') + + debug { + buildConfigField "String", "MERCHANT_ACCOUNT", "\"$merchantAccount\"" + buildConfigField "String", "MERCHANT_SERVER_URL", "\"$merchantServerUrl\"" + buildConfigField "String", "AUTHORIZATION_HEADER_NAME", "\"$authorizationHeaderName\"" + buildConfigField "String", "AUTHORIZATION_HEADER_VALUE", "\"$authorizationHeaderValue\"" + buildConfigField "String", "CLIENT_KEY", "\"$clientKey\"" + buildConfigField "String", "MERCHANT_RECURRING_SERVER_URL", "\"$merchantServerUrl\"" + } + + release { + initWith debug + matchingFallbacks = ['debug'] + } + } +}