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

Update project and make it buildable again #42

Merged
merged 23 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c972e14
Migrate from jcenter and update Gradle plugin/wrapper
vgaidarji Oct 6, 2023
e14a3e8
Remove manual dex options
vgaidarji Oct 6, 2023
526da63
Remove jdepend plugin integration
vgaidarji Oct 6, 2023
6862a7b
Switch to Gradle 7.5.1 version
vgaidarji Dec 4, 2023
b39a850
Remove old Fabric.Crashlytics integration
vgaidarji Dec 4, 2023
97ac990
Update to Gradle 8.2 and add Kotlin plugins
vgaidarji Dec 4, 2023
502aa94
Move from Java to Kotlin
vgaidarji Dec 4, 2023
bf11045
Fix JaCoCo configuration for Kotlin
vgaidarji Dec 4, 2023
3f29854
Remove PMD and Checkstyle from project
vgaidarji Dec 4, 2023
7934bef
Remove old CIs and move them to archive
vgaidarji Mar 15, 2024
b8b292b
Update GitHub Actions CI
vgaidarji Mar 15, 2024
ec5e262
Remove Butterknife and fix UI tests
vgaidarji Mar 15, 2024
48b19f6
Update Mockito and fix unit tests
vgaidarji Mar 15, 2024
69cf527
Integrate with Firebase and update to AndroidX
vgaidarji Mar 15, 2024
42bc3b8
Update GitHub Actions CI to use Firebase App Distro
vgaidarji Mar 15, 2024
c631691
Export and use Firebase service account as file
vgaidarji Mar 15, 2024
586a113
Update coveralls plugin and fix buildDir
vgaidarji Mar 15, 2024
03440ab
Update Android instrumentation tests step
vgaidarji Mar 18, 2024
d319e95
Migrate from Coveralls to Codecov.io
vgaidarji Mar 18, 2024
9a1f911
Fix instrumentation tests on GitHub Actions
vgaidarji Mar 18, 2024
76203ea
Update CircleCI CI setup
vgaidarji Mar 18, 2024
8eaa8af
Update Bitrise.io setup
vgaidarji Mar 18, 2024
cf1b5ec
Update README
vgaidarji Mar 29, 2024
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
48 changes: 0 additions & 48 deletions .bitrise-with-ui-tests.yml

This file was deleted.

159 changes: 107 additions & 52 deletions .bitrise.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,114 @@
---
format_version: 1.3.0
format_version: '13'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: standard
pipelines:
pipelineBuildTestDistribute:
stages:
- stageBuildTestDistribute: {}
stages:
stageBuildTestDistribute:
workflows:
- build: {}
- androidTest: {}
trigger_map:
- push_branch: "*"
workflow: primary
- pull_request_source_branch: "*"
workflow: primary
- push_branch: "*"
pipeline: pipelineBuildTestDistribute
workflows:
primary:
androidTest:
steps:
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]: {}
- [email protected]:
inputs:Switched to shell script from Gradle runner at bitrise (#36)
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x

unset ANDROID_NDK_HOME

./gradlew assembleDebug testDebug jacocoTestReport checkstyle pmd jdepend lintDebug buildDashboard assembleDebugAndroidTest crashlyticsUploadDistributionDebug -PversionCode=$BITRISE_BUILD_NUMBER -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
title: Gradle Build/Test/Analyse/Distribute
# disabled because of https://github.com/vgaidarji/ci-matters/issues/35
# - [email protected]:
# title: Gradle Build/Test/Analyse/Distribute
# inputs:
# - gradle_task: assembleDebug testDebug jacocoTestReport checkstyle pmd jdepend
# lintDebug buildDashboard crashlyticsUploadDistributionDebug -PversionCode=$BITRISE_BUILD_NUMBER
# -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
# - mapping_file_exclude_filter: ''
- [email protected]:
inputs:
- coveralls_task: coveralls -PversionCode=$BITRISE_BUILD_NUMBER -PfabricApiKey=$FABRIC_API_KEY
-PfabricApiSecret=$FABRIC_API_SECRET
- coveralls_repo_token: "$COVERALLS_REPO_TOKEN"
- [email protected]:
title: Deploy test reports to Bitrise.io
inputs:
- deploy_path: "$BITRISE_SOURCE_DIR/app/build/reports/jacocoTestReport/"
- notify_email_list: ''
- [email protected]:
title: Deploy APK to Bitrise.io
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- set-java-version@1:
inputs:
- set_java_version: '17'
- [email protected]: {}
- android-build-for-ui-testing@0:
inputs:
- variant: "$BUILD_TYPE"
- module: app
- avd-manager@1:
inputs:
- tag: default
- abi: x86_64
- api_level: '34'
- wait-for-android-emulator@1: {}
- android-instrumented-test@0: {}
- [email protected]:
title: Deploy build outputs to Bitrise.io
inputs:
- deploy_path: "$BITRISE_SOURCE_DIR/app/build/outputs"
- notify_email_list: ''
- [email protected]:
title: Deploy test reports to Bitrise.io
inputs:
- deploy_path: "$BITRISE_SOURCE_DIR/app/build/reports"
- notify_email_list: ''
build:
steps:
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- set-java-version@1:
inputs:
- set_java_version: '17'
- [email protected]: {}
- android-build@1:
inputs:
- variant: "$BUILD_TYPE"
- [email protected]:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x

./gradlew testDebug jacocoTestReport lintDebug buildDashboard
title: Check
- script@1:
inputs:
- content: |-
#!/usr/bin/env bash
# fail if any commands fails
set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
set -o pipefail
# debug log
set -x

echo $FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON > $BITRISE_SOURCE_DIR/credentials.json
export FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON=$BITRISE_SOURCE_DIR/credentials.json && ./gradlew appDistributionUploadDebug
title: Distribute To Firebase
- codecov@3:
inputs:
- OS: linux
- CODECOV_TOKEN: "$CODECOV_TOKEN"
- [email protected]:
title: Deploy test reports to Bitrise.io
inputs:
- deploy_path: "$BITRISE_SOURCE_DIR/app/build/reports/jacocoTestReport/"
- notify_email_list: ''
- custom-test-results-export@1:
inputs:
- search_pattern: "*/build/test-results/testDebugUnitTest/*"
- test_name: tests
- [email protected]:
title: Deploy APK to Bitrise.io
app:
envs:
- opts:
is_expand: false
GRADLE_BUILD_FILE_PATH: build.gradle
- opts:
is_expand: false
GRADLE_TASK: assembleDebug
- opts:
is_expand: false
GRADLEW_PATH: "./gradlew"
- opts:
is_expand: false
GRADLE_BUILD_FILE_PATH: build.gradle
- opts:
is_expand: false
BUILD_TYPE: debug
- opts:
is_expand: false
GRADLEW_PATH: "./gradlew"
98 changes: 54 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
version: 2
version: 2.1
orbs:
android: circleci/[email protected]
codecov: codecov/[email protected]
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-28-alpha
environment:
JVM_OPTS: -Xmx3200m
ADB_INSTALL_TIMEOUT: 10
TERM: dumb
executor:
name: android/android-machine
tag: 2024.01.1
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- android/change-java-version:
java-version: 17
- android/accept-licenses
- run:
name: Accept Android Licenses
command: yes | sdkmanager --licenses && yes | sdkmanager --update || exit 0
name: Build
command: ./gradlew assembleDebug
- run:
name: Download Dependencies
command: ./gradlew clean androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
name: Check
command: ./gradlew testDebug jacocoTestReport lintDebug buildDashboard
- run:
name: Install Android dependencies
name: Distribute
command: |
sdkmanager "platform-tools"
sdkmanager "platforms;android-15"
sdkmanager "platforms;android-21"
sdkmanager "platforms;android-22"
sdkmanager "platforms;android-25"
sdkmanager "build-tools;24.0.3"
sdkmanager "extras;android;m2repository"
sdkmanager "extras;google;m2repository"
sdkmanager "extras;google;google_play_services"
sdkmanager "system-images;android-21;default;armeabi-v7a"
- run:
name: Setup emulator
command: echo "no" | avdmanager create avd -n test -k "system-images;android-21;default;armeabi-v7a"
- run:
name: Launch emulator
command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator -avd test -noaudio -no-boot-anim -no-window -accel on
background: true
- run:
name: Wait for emulator
command: circle-android wait-for-boot
- run:
name: Run UI tests
command: ./gradlew connectedAndroidTest
- run:
name: Build and check
command: ./gradlew testDebug jacocoTestReport coveralls checkstyle pmd jdepend lintDebug buildDashboard crashlyticsUploadDistributionDebug -PpreDexEnable=false -PversionCode=$CIRCLE_BUILD_NUM -PfabricApiKey=$FABRIC_API_KEY -PfabricApiSecret=$FABRIC_API_SECRET
echo $FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON_B64 | base64 -d | tee $(pwd)/google-services-account.json > /dev/null
export FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON=$(pwd)/google-services-account.json && ./gradlew appDistributionUploadDebug
- codecov/upload
- store_artifacts:
path: app/build/outputs
destination: outputs
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
androidTest:
working_directory: ~/code
executor:
name: android/android-machine
tag: 2024.01.1
steps:
- checkout
- android/change-java-version:
java-version: 17
- android/accept-licenses
- android/create-avd:
avd-name: test
install: true
system-image: system-images;android-32;default;x86_64
- android/start-emulator:
avd-name: test
no-window: true
restore-gradle-cache-prefix: v1a
- android/run-tests:
test-command: ./gradlew connectedAndroidTest --stacktrace
- android/save-gradle-cache:
cache-prefix: v1a
- store_artifacts:
path: app/build/outputs
destination: outputs
Expand All @@ -59,3 +63,9 @@ jobs:
destination: reports
- store_test_results:
path: app/build/test-results

workflows:
build_and_test:
jobs:
- build
- androidTest
Loading
Loading