Skip to content

Commit 1bfd2b0

Browse files
committed
2 parents 857572c + 81aad0b commit 1bfd2b0

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Android CI with Firebase Emulator
2+
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
distribution: 'temurin'
20+
java-version: 17
21+
22+
- name: Set up Android SDK
23+
uses: android-actions/setup-android@v3
24+
25+
- name: Grant Gradlew Permissions
26+
run: chmod +x ./gradlew
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: 18
32+
33+
- name: Install Firebase Tools
34+
run: npm install -g firebase-tools
35+
36+
- name: Start Firebase Emulator (Background)
37+
run: |
38+
firebase emulators:start --only auth,database --project demo-project &
39+
sleep 20 # Ensure emulators are fully started
40+
41+
- name: Run Unit Tests (Located in `test/`)
42+
run: ./gradlew testDebugUnitTest
43+
44+
- name: Start Android Emulator for UI & Integration Tests
45+
uses: reactivecircus/android-emulator-runner@v2
46+
with:
47+
api-level: 33
48+
arch: x86_64
49+
profile: Nexus 6
50+
script: |
51+
# Ensure Emulator is Ready
52+
adb wait-for-device
53+
sleep 10
54+
55+
# Run UI & Integration Tests (Located in `androidTest/`)
56+
./gradlew connectedDebugAndroidTest

0 commit comments

Comments
 (0)