88 branches : [ master ]
99
1010jobs :
11- build :
12- runs-on : macos-latest
13- strategy :
14- matrix :
15- api-level : [ 29 ]
11+ lint :
12+ runs-on : ubuntu-latest
1613 steps :
17- - uses : actions/checkout@v3
18- - name : Cocoapods cache
19- uses : actions/cache@v3
20- id : cocoapods-cache
14+ - uses : actions/checkout@v4
15+ - name : Set up JDK
16+ uses : actions/setup-java@v4
2117 with :
22- path : |
23- ~/.cocoapods
24- ~/Library/Caches/CocoaPods
25- */build/cocoapods
26- */build/classes
27- key : cocoapods-cache
18+ distribution : ' zulu'
19+ java-version : ' 17'
20+ - name : ktLint
21+ run : ./gradlew lintKotlin
22+ - name : run apiCheck
23+ run : ./gradlew apiCheck
24+ jobMatrixSetup :
25+ runs-on : ubuntu-latest
26+ outputs :
27+ emulator_jobs_matrix : ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
28+ ios_test_jobs_matrix : ${{ steps.dataStep.outputs.ios_test_jobs_matrix }}
29+ js_test_jobs_matrix : ${{ steps.dataStep.outputs.js_test_jobs_matrix }}
30+ jvm_test_jobs_matrix : ${{ steps.dataStep.outputs.jvm_test_jobs_matrix }}
31+ steps :
32+ - uses : actions/checkout@v4
2833 - name : Set up JDK
29- uses : actions/setup-java@v3
34+ uses : actions/setup-java@v4
3035 with :
3136 distribution : ' zulu'
32- java-version : ' 11 '
37+ java-version : ' 17 '
3338 cache : gradle
34- - name : Gradle cache
35- uses : gradle/gradle-build-action@v2
36- - name : Grant execute permission for gradlew
37- run : chmod +x gradlew
38- - name : Install Firebase tools
39- run : npm install -g firebase-tools
40- - name : Start Firebase emulator
41- run : " firebase emulators:start --config=./test/firebase.json &"
42- - name : Assemble
43- run : ./gradlew assemble
39+ - name : Prepare the matrix JSON
40+ run : ./gradlew ciJobsMatrixSetup
41+ - id : dataStep
42+ run : |
43+ echo "
44+ emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)
45+ ios_test_jobs_matrix=$(jq -c . < ./build/ios_test_jobs_matrix.json)
46+ js_test_jobs_matrix=$(jq -c . < ./build/js_test_jobs_matrix.json)
47+ jvm_test_jobs_matrix=$(jq -c . < ./build/jvm_test_jobs_matrix.json)
48+ " >> $GITHUB_OUTPUT
49+ build-android :
50+ needs : jobMatrixSetup
51+ runs-on : ubuntu-latest
52+ strategy :
53+ fail-fast : false
54+ matrix : ${{ fromJson(needs.jobMatrixSetup.outputs.emulator_jobs_matrix) }}
55+ steps :
56+ - uses : actions/checkout@v4
57+ - name : Enable KVM group perms
58+ run : |
59+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
60+ sudo udevadm control --reload-rules
61+ sudo udevadm trigger --name-match=kvm
62+ - name : Setup test environment
63+ uses : ./.github/actions/setup_test_action
64+ - name : Set Artifact Name
65+ run : |
66+ echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
67+ - name : Apply Android licenses
68+ run : ./gradlew ciSdkManagerLicenses
69+ - name : Run Android Instrumented Tests
70+ run : ./gradlew ${{ matrix.gradle_tasks }}
71+ - name : Upload Android test artifact
72+ uses : actions/upload-artifact@v4
73+ if : failure()
74+ with :
75+ name : Android ${{ env.ARCHIVE_KEY }} Test Report HTML
76+ path : " **/build/reports/androidTests/"
77+ - name : Upload Firebase Debug Log
78+ uses : actions/upload-artifact@v4
79+ if : failure()
80+ with :
81+ name : Android ${{ env.ARCHIVE_KEY }} Firebase Debug Log
82+ path : " **/firebase-debug.log"
83+ build-js :
84+ needs : jobMatrixSetup
85+ runs-on : ubuntu-latest
86+ strategy :
87+ fail-fast : false
88+ matrix : ${{ fromJson(needs.jobMatrixSetup.outputs.js_test_jobs_matrix) }}
89+ steps :
90+ - uses : actions/checkout@v4
91+ - name : Setup test environment
92+ uses : ./.github/actions/setup_test_action
93+ timeout-minutes : 10
94+ - name : Set Artifact Name
95+ run : |
96+ echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
4497 - name : Run JS Tests
45- run : ./gradlew cleanTest jsLegacyTest
98+ run : ./gradlew ${{ matrix.gradle_tasks }}
4699 - name : Upload JS test artifact
47- uses : actions/upload-artifact@v3
100+ uses : actions/upload-artifact@v4
48101 if : failure()
49102 with :
50- name : " JS Test Report HTML"
103+ name : JS ${{ env.ARCHIVE_KEY }} Test Report HTML
51104 path : |
52- **/build/reports/tests/jsLegacyTest/
53- **/build/reports/tests/jsLegacyBrowserTest/
54- **/build/reports/tests/jsLegacyNodeTest/
55- - name : Run iOS Tests
56- run : ./gradlew cleanTest iosX64Test
57- - name : Upload iOS test artifact
58- uses : actions/upload-artifact@v3
105+ **/build/reports/tests/jsTest/
106+ **/build/reports/tests/jsBrowserTest/
107+ **/build/reports/tests/jsNodeTest/
108+ - name : Upload Firebase Debug Log
109+ uses : actions/upload-artifact@v4
59110 if : failure()
60111 with :
61- name : " iOS Test Report HTML"
62- path : " **/build/reports/tests/iosX64Test/"
63- - name : AVD cache
64- uses : actions/cache@v3
65- id : avd-cache
112+ name : JS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
113+ path : " **/firebase-debug.log"
114+ build-ios :
115+ needs : jobMatrixSetup
116+ runs-on : macos-latest
117+ strategy :
118+ fail-fast : false
119+ matrix : ${{ fromJson(needs.jobMatrixSetup.outputs.ios_test_jobs_matrix) }}
120+ steps :
121+ - uses : actions/checkout@v4
122+ - name : Cocoapods cache
123+ uses : actions/cache@v4
66124 with :
67125 path : |
68- ~/.android/avd/*
69- ~/.android/adb*
70- key : avd-${{ matrix.api-level }}
71- - name : create AVD and generate snapshot for caching
72- if : steps.avd-cache.outputs.cache-hit != 'true'
73- uses : reactivecircus/android-emulator-runner@v2
126+ ~/.cocoapods
127+ ~/Library/Caches/CocoaPods
128+ */build/cocoapods
129+ */build/classes
130+ key : cocoapods-cache-v2
131+ - name : Setup test environment
132+ uses : ./.github/actions/setup_test_action
133+ - name : Set Artifact Name
134+ run : |
135+ echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
136+ - name : Run iOS Tests
137+ run : ./gradlew ${{ matrix.gradle_tasks }}
138+ - name : Upload iOS test artifact
139+ uses : actions/upload-artifact@v4
140+ if : failure()
74141 with :
75- api-level : ${{ matrix.api-level }}
76- force-avd-creation : false
77- emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
78- disable-animations : false
79- script : echo "Generated AVD snapshot for caching."
80- - name : Run Android Instrumented Tests
81- uses : reactivecircus/android-emulator-runner@v2
142+ name : iOS ${{ env.ARCHIVE_KEY }} Test Report HTML
143+ path : " **/build/reports/tests/iosSimulatorArm64Test/"
144+ - name : Upload Firebase Debug Log
145+ uses : actions/upload-artifact@v4
146+ if : failure()
82147 with :
83- api-level : ${{ matrix.api-level }}
84- force-avd-creation : false
85- emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
86- disable-animations : true
87- script : ./gradlew connectedAndroidTest
88- - name : Upload Android test artifact
89- uses : actions/upload-artifact@v3
148+ name : iOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
149+ path : " **/firebase-debug.log"
150+ build-jvm :
151+ needs : jobMatrixSetup
152+ runs-on : ubuntu-latest
153+ strategy :
154+ fail-fast : false
155+ matrix : ${{ fromJson(needs.jobMatrixSetup.outputs.jvm_test_jobs_matrix) }}
156+ steps :
157+ - uses : actions/checkout@v4
158+ - name : Setup test environment
159+ uses : ./.github/actions/setup_test_action
160+ timeout-minutes : 10
161+ - name : Set Artifact Name
162+ run : |
163+ echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
164+ - name : Run JVM Tests
165+ run : ./gradlew ${{ matrix.gradle_tasks }}
166+ - name : Upload JVM test artifact
167+ uses : actions/upload-artifact@v4
90168 if : failure()
91169 with :
92- name : " Android Test Report HTML"
93- path : " **/build/reports/androidTests/"
170+ name : JVM ${{ env.ARCHIVE_KEY }} Test Report HTML
171+ path : |
172+ **/build/reports/tests/jvmTest/
173+ - name : Upload Firebase Debug Log
174+ uses : actions/upload-artifact@v4
175+ if : failure()
176+ with :
177+ name : JVM ${{ env.ARCHIVE_KEY }} Firebase Debug Log
178+ path : " **/firebase-debug.log"
0 commit comments