From c8f89e755e24a022c4f8a73ec7cb05ef3d47152c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 08:49:29 +0000 Subject: [PATCH 1/3] Add GitHub Actions workflow for build and test - Add automated build and test workflow for CI/CD - Workflow runs on push and pull requests to main/master/develop branches - Includes Gradle caching for faster builds - Runs build, unit tests, and lint checks - Uploads build artifacts and reports on failure - Uploads debug APK on successful builds --- .github/workflows/build-and-test.yml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..8b7e13f --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,61 @@ +name: Build and Test + +on: + push: + branches: [ main, master, develop ] + pull_request: + branches: [ main, master, develop ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Cache Gradle packages + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build with Gradle + run: ./gradlew build --stacktrace + + - name: Run unit tests + run: ./gradlew test --stacktrace + + - name: Run lint checks + run: ./gradlew lint --stacktrace + + - name: Upload build reports + if: failure() + uses: actions/upload-artifact@v4 + with: + name: build-reports + path: | + app/build/reports/ + app/build/test-results/ + retention-days: 7 + + - name: Upload APK + if: success() + uses: actions/upload-artifact@v4 + with: + name: app-debug + path: app/build/outputs/apk/debug/*.apk + retention-days: 7 From a65e279734b4bf3904c76b134b7293a83f22c077 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 08:58:50 +0000 Subject: [PATCH 2/3] Add missing Firebase Firestore dependency Fix build error by explicitly adding firebase-firestore dependency required by firebase-ui-firestore. --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle b/app/build.gradle index 8386a24..2e6919d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -42,6 +42,7 @@ dependencies { implementation 'com.jakewharton.timber:timber:4.7.1' implementation 'com.github.hotchemi:android-rate:1.0.1' implementation 'com.firebaseui:firebase-ui-firestore:7.1.1' + implementation 'com.google.firebase:firebase-firestore:22.0.1' implementation 'com.google.firebase:firebase-crashlytics:17.3.0' implementation 'com.google.firebase:firebase-analytics:18.0.0' implementation 'com.google.firebase:firebase-database:19.6.0' From b612bf843b5ded21068233c5d76b673498992deb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 09:01:53 +0000 Subject: [PATCH 3/3] Fix CI build by adding mock google-services.json The google-services.json file is gitignored for security reasons. Added a step in the CI workflow to generate a mock configuration file with dummy values that allows the build to complete successfully. --- .github/workflows/build-and-test.yml | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8b7e13f..3c41226 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -23,6 +23,51 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew + - name: Create mock google-services.json for CI + run: | + cat > app/google-services.json << 'EOF' + { + "project_info": { + "project_number": "123456789", + "firebase_url": "https://mock-project.firebaseio.com", + "project_id": "mock-project", + "storage_bucket": "mock-project.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:123456789:android:abcdef123456", + "android_client_info": { + "package_name": "me.cutmail.disasterapp" + } + }, + "oauth_client": [ + { + "client_id": "123456789-abcdefghijklmnop.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDummyKeyForCIBuildOnly123456789" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "123456789-abcdefghijklmnop.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" + } + EOF + - name: Cache Gradle packages uses: actions/cache@v4 with: