File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments