forked from GitLiveApp/firebase-kotlin-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (98 loc) · 3.34 KB
/
pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Pull Request
on:
pull_request:
branches: [ master, prerelease ]
jobs:
build:
runs-on: macos-13
strategy:
matrix:
api-level: [ 34 ]
steps:
- uses: actions/checkout@v3
- name: Cocoapods cache
uses: actions/cache@v3
id: cocoapods-cache
with:
path: |
~/.cocoapods
~/Library/Caches/CocoaPods
*/build/cocoapods
*/build/classes
key: cocoapods-cache
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: gradle
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Install Firebase tools
run: npm install -g firebase-tools
- name: Start Firebase emulator
run: "firebase emulators:start --config=./test/firebase.json &"
- name: Run JS Tests
run: ./gradlew cleanTest jsTest
- name: Upload JS test artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: "JS Test Report HTML"
path: |
**/build/reports/tests/jsTest/
**/build/reports/tests/jsBrowserTest/
**/build/reports/tests/jsNodeTest/
- name: Run iOS Tests
run: ./gradlew cleanTest iosX64Test
- name: Upload iOS test artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: "iOS Test Report HTML"
path: "**/build/reports/tests/iosX64Test/"
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run Android Instrumented Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedAndroidTest
- name: Upload Android test artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Android Test Report HTML"
path: "**/build/reports/androidTests/"
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Firebase Debug Log"
path: "**/firebase-debug.log"