-
Notifications
You must be signed in to change notification settings - Fork 1
212 lines (199 loc) · 6.58 KB
/
Copy pathbuild.yml
File metadata and controls
212 lines (199 loc) · 6.58 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Test
on:
pull_request_target:
branches:
- master
paths-ignore:
- 'doc/**'
- '**.md'
- '**.txt'
push:
branches:
- master
paths-ignore:
- 'doc/**'
- '**.md'
- '**.txt'
jobs:
test-linux:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/actions/build-setup
with:
configuration_cache_key: secrets.GRADLE_CONFIGURATION_CACHE_KEY
- name: Build and Test
run: |
./gradlew allTests assembleAndroidDeviceTest assembleAndroidDeviceTest \
-PkniNativeBuildType=debug \
-PkniAllowedTargets=linuxX64,androidNativeArm64,wasmJs,js,wasmWasi
env:
GRADLE_OPTS: >-
-Dorg.gradle.jvmargs="-Xmx12g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m"
-Dkotlin.daemon.jvm.options="-Xmx2048m"
- name: Upload Test Report
uses: actions/upload-artifact@v7
if: always()
with:
name: test-report-ubuntu-latest
path: ./**/build/test-results/**/*.xml
retention-days: 5
- name: Upload Android Test APK (e2e)
uses: actions/upload-artifact@v7
if: always()
with:
name: e2e-androidTest.apk
path: ./e2e/build/outputs/apk/androidTest/e2e-androidTest.apk
archive: false
- name: Upload Android Test APK (plugintest)
uses: actions/upload-artifact@v7
if: always()
with:
name: plugintest-androidTest.apk
path: ./plugintest/build/outputs/apk/androidTest/plugintest-androidTest.apk
archive: false
- name: Upload Android Test APK (buffers)
uses: actions/upload-artifact@v7
if: always()
with:
name: buffers-androidTest.apk
path: ./buffers/build/outputs/apk/androidTest/buffers-androidTest.apk
archive: false
test-windows:
permissions:
contents: read
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/actions/build-setup
with:
configuration_cache_key: secrets.GRADLE_CONFIGURATION_CACHE_KEY
- name: Build and Test
run: ./gradlew allTests -PkniNativeBuildType=debug -PkniAllowedTargets=mingwX64
env:
GRADLE_OPTS: >-
-Dorg.gradle.jvmargs="-Xmx12g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m"
-Dkotlin.daemon.jvm.options="-Xmx2048m"
- name: Upload Test Report
uses: actions/upload-artifact@v7
if: always()
with:
name: test-report-windows-latest
path: ./**/build/test-results/**/*.xml
test-macos:
permissions:
contents: read
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup
uses: ./.github/actions/build-setup
with:
configuration_cache_key: secrets.GRADLE_CONFIGURATION_CACHE_KEY
- name: Build and Test
run: |
./gradlew allTests -PkniNativeBuildType=debug \
-PkniAllowedTargets=macosArm64,iosSimulatorArm64,tvosSimulatorArm64,watchosSimulatorArm64
env:
GRADLE_OPTS: >-
-Dorg.gradle.jvmargs="-Xmx5g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m"
-Dkotlin.daemon.jvm.options="-Xmx2048m"
- name: Upload Test Report
uses: actions/upload-artifact@v7
if: always()
with:
name: test-report-macos-latest
path: ./**/build/test-results/**/*.xml
test-android:
needs: ["test-linux"]
strategy:
matrix:
module: ["e2e", "plugintest", "buffers"]
fail-fast: false
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v8
with:
name: ${{matrix.module}}-androidTest.apk
- name: Set up google cloud
uses: google-github-actions/setup-gcloud@v1
with:
service_account_key: ${{ secrets.GCLOUD_AUTH }}
- name: Auth google cloud
uses: 'google-github-actions/auth@v3'
with:
project_id: 'kotlin-jni'
credentials_json: ${{ secrets.GCLOUD_AUTH }}
- name: Set current project
run: gcloud config set project ${{ secrets.FIREBASE_PROJECT_ID }}
- name: Run Instrumentation Tests in Firebase Test Lab
continue-on-error: true
env:
APP_DEBUG_LOCATION: ${{matrix.module}}-androidTest.apk
ANDROID_TEST_LOCATION: ${{matrix.module}}-androidTest.apk
DEVICE_MODEL: SmallPhone.arm,version=35
run: >
gcloud firebase test android run
--type instrumentation
--app $APP_DEBUG_LOCATION
--test $ANDROID_TEST_LOCATION
--device model=$DEVICE_MODEL
--results-bucket=jni-firebase-test
--results-dir="run-${{ github.run_id }}"
--no-record-video
- name: Download Results
run: |
mkdir -p firebase-results/${{matrix.module}}
# Replace 'your-bucket-name' with your actual bucket (e.g. test-lab-xxxx)
gcloud storage cp -r "gs://jni-firebase-test/run-${{ github.run_id }}/**/test_result_*.xml" ./firebase-results/${{matrix.module}}/
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: test-report-ubuntu-android-${{matrix.module}}
path: firebase-results/${{matrix.module}}/
publish-results:
needs:
- test-linux
- test-android
- test-macos
- test-windows
runs-on: ubuntu-latest
if: always()
permissions:
contents: read
checks: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
sparse-checkout: |
.github/actions
- name: Download Artifacts
uses: actions/download-artifact@v8
- name: Multiplatform Test Report
uses: dshatz/testballoon-github-reporter@master
with:
reports: "test-report-*/**/*.xml"
platform-hints: |
{
"test-report-ubuntu-latest/**/*.xml": "Linux",
"test-report-windows-latest/**/*.xml": "Windows",
"test-report-macos-latest/**/*.xml": "macOS",
"test-report-ubuntu-android-*/**/*.xml": "Android"
}