Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
106 changes: 106 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
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: 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:
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
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down