-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Gradle Error & Refactor Multiple Activity to Single Activity (#1750)
* Fix Gradle Error & Refactor Multiple Activity to Single Activity * Fixed Build Error * Fixed CI Workflow Usage * Fixed CI Workflow Usage * Fixed CI Workflow * Fixing CI Workflow Usage * Fixing CI Workflow Usage * CI - Rename dependency check job to dependency guard * CI - Trigger workflow on pull requests * CI - Updated CI Workflow Usage
- Loading branch information
Showing
155 changed files
with
4,302 additions
and
2,936 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,158 +1,144 @@ | ||
name: Mobile-Wallet CI[Master/Dev] | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'dev' | ||
- 'master' | ||
- 'payment_hub' | ||
branches: [ dev, master, payment_hub ] | ||
pull_request: | ||
|
||
concurrency: | ||
group: build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build APK | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Set up JDK | ||
- name: Set Up JDK 17 | ||
uses: actions/setup-java@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- uses: gradle/actions/setup-gradle@v4 | ||
|
||
# Install NDK | ||
#- name: Install NDK | ||
# run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT} | ||
|
||
# Update Gradle Permission | ||
- name: Change gradlew Permission | ||
run: chmod +x gradlew | ||
|
||
# Turing off detekt check until migration finished | ||
# - name: Check Dependency Guard | ||
# id: dependencyguard_verify | ||
# continue-on-error: true | ||
# run: ./gradlew dependencyGuard | ||
# | ||
# - name: Prevent updating Dependency Guard baselines if this is a fork | ||
# id: checkfork_dependencyguard | ||
# continue-on-error: false | ||
# if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository | ||
# run: | | ||
# echo "::error::Dependency Guard failed, please update baselines with: ./gradlew dependencyGuardBaseline" && exit 1 | ||
|
||
# Build App | ||
- name: Build with Gradle | ||
run: ./gradlew assemble | ||
|
||
# Upload Built APK | ||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v2.2.0 | ||
- name: Cache Gradle and build outputs | ||
uses: actions/cache@v4 | ||
with: | ||
name: mobile-wallet | ||
path: mifospay/build/outputs/apk/debug/ | ||
|
||
# Turing off detekt check until migration finished | ||
# lintCheck: | ||
# name: Static Analysis | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# | ||
# # Setup JDK 17 | ||
# - name: Setup JDK 17 | ||
# uses: actions/setup-java@v1 | ||
# with: | ||
# java-version: 17 | ||
# | ||
# - name: Detekt For All Modules | ||
# run: ./gradlew detekt | ||
|
||
pmd: | ||
name: PMD | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
build | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: ${{ runner.os }}-gradle- | ||
|
||
checks: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
check: [ build_logic, spotless, detekt ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup JDK 17 | ||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- uses: actions/checkout@v4 | ||
- name: PMD Check[MifosPay] | ||
run: ./gradlew mifospay:pmd | ||
|
||
- name: Upload PMD Report[MifosPay] | ||
uses: actions/upload-artifact@v3.1.3 | ||
if: failure() | ||
- name: Run ${{ matrix.check }} | ||
id: run_check | ||
run: | | ||
if [ "${{ matrix.check }}" = "build_logic" ]; then | ||
./gradlew check -p build-logic | ||
elif [ "${{ matrix.check }}" = "spotless" ]; then | ||
./gradlew spotlessCheck --no-configuration-cache --no-daemon | ||
elif [ "${{ matrix.check }}" = "detekt" ]; then | ||
./gradlew detekt | ||
fi | ||
- name: Upload Detekt Reports | ||
if: ${{ matrix.check }} == 'detekt' && steps.run_check.outcome == 'success' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: PMD Report[MifosPay] | ||
path: mifospay/build/reports/ | ||
|
||
- name: PMD Check[Core:Datastore] | ||
run: ./gradlew core:datastore:pmd | ||
|
||
- name: PMD Check[Core:Data] | ||
run: ./gradlew core:data:pmd | ||
|
||
- name: PMD Check[Core:DesignSystem] | ||
run: ./gradlew core:designsystem:pmd | ||
|
||
- name: PMD Check[Core:Common] | ||
run: ./gradlew core:common:pmd | ||
|
||
- name: PMD Check[Core:Network] | ||
run: ./gradlew core:network:pmd | ||
|
||
- name: PMD Check[Core:Model] | ||
run: ./gradlew core:model:pmd | ||
name: detekt-reports | ||
path: | | ||
**/build/reports/detekt/detekt.md | ||
- name: PMD Check[Feature:Auth] | ||
run: ./gradlew feature:auth:pmd | ||
checkstyle: | ||
name: Checkstyle | ||
dependency_guard: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Setup JDK 17 | ||
- name: Setup JDK 17 | ||
uses: actions/setup-java@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Checkstyle[MifosPay] | ||
run: ./gradlew mifospay:checkstyle | ||
|
||
- name: Upload Checkstyle Report[MifosPay] | ||
uses: actions/upload-artifact@v2.2.0 | ||
if: failure() | ||
- name: Check Dependency Guard | ||
id: dependencyguard_verify | ||
continue-on-error: true | ||
run: ./gradlew dependencyGuard | ||
|
||
- name: Prevent updating Dependency Guard baselines if this is a fork | ||
id: checkfork_dependencyguard | ||
continue-on-error: false | ||
if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository | ||
run: | | ||
echo "::error::Dependency Guard failed, please update baselines with: ./gradlew dependencyGuardBaseline" && exit 1 | ||
# Runs if previous job failed | ||
- name: Generate new Dependency Guard baselines if verification failed and it's a PR | ||
id: dependencyguard_baseline | ||
if: steps.dependencyguard_verify.outcome == 'failure' && github.event_name == 'pull_request' | ||
run: | | ||
./gradlew dependencyGuardBaseline | ||
- name: Push new Dependency Guard baselines if available | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
if: steps.dependencyguard_baseline.outcome == 'success' | ||
with: | ||
name: Checkstyle Report[MifosPay] | ||
path: mifospay/build/reports/ | ||
file_pattern: '**/dependencies/*.txt' | ||
disable_globbing: true | ||
commit_message: "🤖 Updates baselines for Dependency Guard" | ||
|
||
- name: Static Analysis[Core:Datastore] | ||
run: ./gradlew core:datastore:checkstyle | ||
|
||
- name: Static Analysis[Core:Data] | ||
run: ./gradlew core:data:checkstyle | ||
tests_and_lint: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
- name: Run tests | ||
run: | | ||
./gradlew testDemoDebug | ||
- name: Upload reports | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-and-lint-reports | ||
path: | | ||
**/build/test-results/test*UnitTest/**.xml | ||
- name: Static Analysis[Core:DesignSystem] | ||
run: ./gradlew core:designsystem:checkstyle | ||
build: | ||
needs: [ checks, tests_and_lint ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- name: Static Analysis[Core:Common] | ||
run: ./gradlew core:common:checkstyle | ||
- name: Build APKs | ||
run: ./gradlew :app:assemble | ||
|
||
- name: Static Analysis[Core:Network] | ||
run: ./gradlew core:network:checkstyle | ||
- name: Check badging | ||
run: ./gradlew :app:checkProdReleaseBadging | ||
|
||
- name: Static Analysis[Core:Model] | ||
run: ./gradlew core:model:checkstyle | ||
- name: Upload APKs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: APKs | ||
path: '**/build/outputs/apk/**/*.apk' | ||
|
||
- name: Static Analysis[Feature:Auth] | ||
run: ./gradlew feature:auth:checkstyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,6 @@ interface UserDataRepository { | |
* Stream of [UserData] | ||
*/ | ||
val userData: Flow<UserData> | ||
|
||
fun logOut(): Unit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.