Skip to content

Instantly share code, notes, and snippets.

<TextView
android:id="@+id/tvTotalAmount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="32dp"
android:textAppearance="@style/TextAppearance.AppCompat.Display4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
desc "Deploy latest version to Google Play"
lane :playstore do |options|
gradle(
task: "assemble",
flavor: options[:build_flavor],
build_type: options[:build_type],
properties: {
"android.injected.signing.store.file" => "fastlane-droid.jks",
"android.injected.signing.store.password" => ENV['STORE_PASSWORD'],
"android.injected.signing.key.alias" => ENV['KEY_ALIAS'],
# ---------------------------------------------------------------------------------------------------------------------
# DECODE GOOGLE_PLAY_JSON_KEY AND WRITE IT TO A FILE
# ---------------------------------------------------------------------------------------------------------------------
decode_gplay_key: &decode_gplay_key
run:
name: Decode Google Play JSON key
command: |
echo $GOOGLE_PLAY_JSON_KEY | base64 -d | tee google-play-json-key-file.json >/dev/null
workflows:
version: 2
workflow:
# Jobs that will run when you push to your repo
jobs:
- test_unit
- test_instrumentation:
requires:
- test_unit
workflows:
version: 2
workflow:
# Jobs that will run when you push to your repo
jobs:
- test_unit
- test_instrumentation:
requires:
- test_unit
# ---------------------------------------------------------------------------------------------------------------------
# DECODE FIREBASE GOOGLE_SERVICE_JSON FILE AND WRITE IT TO A FILE
# ---------------------------------------------------------------------------------------------------------------------
decode_gservices_key: &decode_gservices_key
run:
name: Decode Google Services JSON key
command: |
echo $GOOGLE_SERVICES_JSON | base64 -d | tee app/google-services.json app/src/mock/google-services.json app/src/prod/google-services.json app/src/dev/google-services.json app/src/qa/google-services.json >/dev/null
# Run Instrumentation Tests
test_instrumentation:
<<: *android_config
steps:
- checkout
- *restore_gradle_cache
- *restore_gems_cache
- *android_dependencies
- *ruby_dependencies
- *save_gradle_cache
@TheDancerCodes
TheDancerCodes / test_unit_run
Last active June 16, 2020 10:12
Update command for the test_unit job.
## Run unit tests
test_unit:
<<: *android_config
steps:
- checkout
- *restore_gradle_cache
- *restore_gems_cache
- *android_dependencies
- *ruby_dependencies
- *save_gradle_cache
desc "Run Instrumented tests in Firebase Test Lab"
lane :instrumentation_tests_firebase_testlab do |options|
assemble_build(build_flavor:options[:build_flavor], build_type:"Debug")
@app_apk = Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
assemble_build(build_flavor:options[:build_flavor] + "Debug", build_type:"AndroidTest")
@android_test_apk = Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
run_tests_firebase_testlab(
project_id: ENV["FIREBASE_PROJECT_ID"],
desc "Run Unit Tests"
lane :unit_tests do |options|
gradle(
task: "test",
flavor: options[:build_flavor],
build_type: options[:build_type]
)
end