Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
208a7d9
apply sonar gradle plugin
superus8r Mar 2, 2023
2af25c1
set usesCleartextTraffic to false
superus8r Mar 2, 2023
da6ab6d
add a CircleCI step to analyze on SonarCloud
superus8r Mar 2, 2023
7b0d13c
apply SonarCloud context to build
superus8r Mar 2, 2023
9484f1a
use lintDebug instead of lint
superus8r Mar 2, 2023
9da2373
Update config.yml
superus8r Mar 9, 2023
8bc7e1c
cleanup; no changes
superus8r Mar 9, 2023
e22c184
update structure; add sonarqube config
superus8r Mar 9, 2023
ef84962
remove extra steps, save gradle cache after generating jacoco reports
superus8r Mar 9, 2023
bef1632
add info about testing using gradle managed devices, firebase crashly…
superus8r Mar 9, 2023
9b902c1
add info about testing using gradle managed devices
superus8r Mar 9, 2023
03e0910
specify jacoco custom output file path for sonar coverage
superus8r Mar 9, 2023
45977ac
add sonar.java.binaries path
superus8r Mar 10, 2023
175528d
update SonarScanner gradle properties; update README
superus8r Mar 11, 2023
5f8e09f
create a gradle task to generate google-services.json file from env vars
superus8r Mar 11, 2023
3c9875a
create a gradle task to generate the ksProp file for signing
superus8r Mar 11, 2023
190fa9d
update config.yml
superus8r Mar 11, 2023
79b933a
fix an issue with keystore.properties path while using the gradle tas…
superus8r Mar 11, 2023
66265fb
update sonar
superus8r Mar 11, 2023
71425f8
distribute the debug version to firebase appTester
superus8r Mar 11, 2023
c2b5ba1
check if keyStore properties are loaded before creating the default c…
superus8r Mar 11, 2023
33046e8
use findByName instead of getByName for release signing config
superus8r Mar 11, 2023
f306e4c
add firebase_app_distribution plugin for fastlate
superus8r Mar 11, 2023
a77ab32
use gradle tasks to prepare the build on Github actions
superus8r Mar 11, 2023
98140a1
use fastlane to run all tests and generate coverage
superus8r Mar 11, 2023
352e252
define env for google-servies.json file
superus8r Mar 11, 2023
63a6fef
remove unnecessary commands which is already handled by fastlane
superus8r Mar 11, 2023
5d9ea84
run bundle update before executing fastlane command
superus8r Mar 11, 2023
1184ffc
install ruby to run fastlane
superus8r Mar 11, 2023
7a91b06
install bundler using ruby gems
superus8r Mar 11, 2023
036aa00
hopefully setup github actions cache for gradle
superus8r Mar 11, 2023
326ae8d
hopefully activate bundler cache on circleci
superus8r Mar 11, 2023
54127a4
hopefully activate bundler cache on circleci
superus8r Mar 11, 2023
19ec385
use fastlane to prepare the tests build
superus8r Mar 11, 2023
a1fc463
remove unnecessary python scrips which are already available as gradl…
superus8r Mar 11, 2023
327376b
Update config.yml
superus8r Mar 11, 2023
68ad67d
Update config.yml
superus8r Mar 11, 2023
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
52 changes: 38 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2.1
orbs:
codecov: codecov/codecov@3.2.4
ruby: circleci/ruby@2.0.0

commands:
restore_gradle_cache:
Expand All @@ -21,34 +22,57 @@ commands:
- ~/.gradle/caches
key: v1-gradle-cache-{{ arch }}-{{ checksum "build.gradle" }}

jobs:
android-test:
executors:
android-machine:
machine:
image: android:2022.12.1
android-docker:
docker:
- image: cimg/android:2023.02

jobs:
android-test:
executor: android-machine
resource_class: large
steps:
- run: lsb_release -a
- checkout
- run: python3 scripts/generateKsPropFile.py
- run: python3 scripts/generateGoogleServicesJson.py
- restore_gradle_cache
- run: ./gradlew tasks
- ruby/install-deps:
with-cache: true
- run:
name: Fastlane - run all tests with coverage report
command: |
bundle exec fastlane testDev
- save_gradle_cache
- run: sdkmanager --list
- run: (yes || true) | sdkmanager "tools" "platform-tools" "build-tools;33.0.2" "platforms;android-33" "system-images;android-30;google_atd;x86"
- run: (yes || true) | sdkmanager --licenses
- run: ./gradlew assembleDebug --stacktrace
- run: ./gradlew pixel2api30DebugAndroidTest --stacktrace
- run: ./gradlew testDebugUnitTest --stacktrace
- run: ./gradlew jacocoTestReport --stacktrace
- run:
name: Analyze on SonarCloud
command: ./gradlew lintDebug sonar
- codecov/upload:
file: app/build/mergedReportDir/jacocoTestReport/jacocoTestReport.xml
- store_test_results:
path: app/build/test-results/testDebugUnitTest
- store_artifacts:
path: app/build/mergedReportDir

distribute-dev:
executor: android-docker
resource_class: large
steps:
- checkout
- restore_gradle_cache
- run:
name: Prepare Fastlane
command: sudo bundle update
- run:
name: Distribute to Firebase AppTester
command: bundle exec fastlane distDev
- store_artifacts:
path: /home/circleci/project/app/build/outputs/apk/debug/app-debug.apk
destination: fastlane-output-debug

workflows:
workflow:
jobs:
- android-test
- android-test:
context: SonarCloud
- distribute-dev
57 changes: 26 additions & 31 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,31 @@ jobs:
with:
ruby-version: '3.0'
bundler-cache: true

- name: set up JDK 11
uses: actions/setup-java@v1
with:
distribution: 'zulu'
java-version: '11'
- name: set up Python
uses: actions/setup-python@v4
- name: Cache Gradle wrapper
uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: ${{ runner.OS }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.OS }}-gradle-wrapper-cache-
- name: Cache Gradle caches
uses: actions/cache@v3
with:
python-version: '3.10'
path: ~/.gradle/caches
key: ${{ runner.OS }}-gradle-caches-cache-${{ hashFiles('build.gradle') }}
restore-keys: |
${{ runner.OS }}-gradle-caches-cache-
- name: generate ksProp file
run: python scripts/generateKsPropFile.py
- name: create google-services.json file
run: cat app/google-services.json | base64
- name: update google-services.json file
run: ./gradlew generateKsPropFile
- name: generate google-services.json file
run: ./gradlew generateGoogleServicesJson
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > app/google-services.json
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: setup fastlane
run: bundle install
- name: run unit tests
Expand All @@ -49,18 +56,12 @@ jobs:
with:
distribution: 'zulu'
java-version: '11'
- name: set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: generate ksProp file
run: python scripts/generateKsPropFile.py
- name: create google-services.json file
run: cat app/google-services.json | base64
- name: update google-services.json file
run: ./gradlew generateKsPropFile
- name: generate google-services.json file
run: ./gradlew generateGoogleServicesJson
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > app/google-services.json
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: Lint
run: bash ./gradlew lintDebug
- name: Lint results
Expand All @@ -70,7 +71,7 @@ jobs:
path: app/build/reports/lint-results-debug.html

ui-test:
runs-on: macOS-latest
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -79,18 +80,12 @@ jobs:
with:
distribution: 'zulu'
java-version: '11'
- name: set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: generate ksProp file
run: python scripts/generateKsPropFile.py
- name: create google-services.json file
run: cat app/google-services.json | base64
- name: update google-services.json file
run: ./gradlew generateKsPropFile
- name: generate google-services.json file
run: ./gradlew generateGoogleServicesJson
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > app/google-services.json
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source "https://rubygems.org"

gem "fastlane"
gem "fastlane"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
64 changes: 33 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
CFPropertyList (3.0.6)
rexml
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.642.0)
aws-sdk-core (3.158.0)
aws-partitions (1.725.0)
aws-sdk-core (3.170.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.58.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (1.63.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.114.0)
aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-s3 (1.119.1)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
Expand All @@ -36,8 +36,8 @@ GEM
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.93.0)
faraday (1.10.2)
excon (0.99.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand Down Expand Up @@ -66,7 +66,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
fastlane (2.210.1)
fastlane (2.212.1)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -105,10 +105,11 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-firebase_app_distribution (0.5.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.29.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-core (0.9.0)
google-apis-androidpublisher_v3 (0.35.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
Expand All @@ -117,27 +118,27 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.15.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-playcustomapp_v1 (0.11.0)
google-apis-core (>= 0.9.0, < 2.a)
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.9.0, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.0)
google-cloud-storage (1.43.0)
google-cloud-errors (1.3.1)
google-cloud-storage (1.44.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.19.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.2.0)
googleauth (1.3.0)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -148,20 +149,20 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.1)
json (2.6.2)
jwt (2.5.0)
jmespath (1.6.2)
json (2.6.3)
jwt (2.7.0)
memoist (0.16.2)
mini_magick (4.11.0)
mini_magick (4.12.0)
mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
os (1.1.4)
plist (3.6.0)
public_suffix (5.0.0)
plist (3.7.0)
public_suffix (5.0.1)
rake (13.0.6)
representable (3.2.0)
declarative (< 0.1.0)
Expand All @@ -178,7 +179,7 @@ GEM
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
simctl (1.6.10)
CFPropertyList
naturally
terminal-notifier (2.0.0)
Expand All @@ -195,7 +196,7 @@ GEM
unf_ext (0.0.8.2)
unf_ext (0.0.8.2-x64-mingw32)
unicode-display_width (1.8.0)
webrick (1.7.0)
webrick (1.8.1)
word_wrap (1.0.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
Expand All @@ -217,6 +218,7 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-firebase_app_distribution

BUNDLED WITH
2.3.7
2.4.7
Loading