forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (153 loc) · 6.08 KB
/
Copy pathandroid_builds.yml
File metadata and controls
177 lines (153 loc) · 6.08 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
name: 🤖 Android Builds
on:
workflow_call:
secrets:
SERVICE_ACCOUNT_KEY:
required: true
workflow_dispatch:
# Global Settings
env:
SCONS_FLAGS: >-
dev_mode=yes
module_text_server_fb_enabled=yes
swappy=yes
jobs:
build-android:
runs-on: ubuntu-24.04
name: ${{ matrix.name }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: Editor (target=editor)
cache-name: android-editor
target: editor
instrumented_tests: true
scons-flags: >-
arch=arm64
production=yes
- name: Template arm32 (target=template_debug, arch=arm32)
cache-name: android-template-arm32
target: template_debug
instrumented_tests: false
scons-flags: arch=arm32
- name: Template arm64 (target=template_debug, arch=arm64)
cache-name: android-template-arm64
target: template_debug
instrumented_tests: true
scons-flags: arch=arm64
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup Python and SCons
uses: ./.github/actions/godot-deps
- name: Download Swappy
run: python ./misc/scripts/install_swappy_android.py
- name: Compilation
uses: ./.github/actions/godot-build
with:
scons-flags: ${{ env.SCONS_FLAGS }} ${{ matrix.scons-flags }}
platform: android
target: ${{ matrix.target }}
- name: Save Godot build cache
uses: ./.github/actions/godot-cache-save
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Generate Godot templates
if: matrix.target == 'template_debug'
run: |
cd platform/android/java
./gradlew generateGodotTemplates
cd ../../..
ls -l bin/
- name: Generate Godot editor
if: matrix.target == 'editor'
run: |
cd platform/android/java
./gradlew generateGodotEditor
./gradlew generateGodotHorizonOSEditor
./gradlew generateGodotPicoOSEditor
cd ../../..
ls -l bin/android_editor_builds/
# Separate different editors for multiple artifacts
mkdir horizonos
mv bin/android_editor_builds/*-horizonos-* horizonos
mkdir picoos
mv bin/android_editor_builds/*-picoos-* picoos
- name: Upload artifact
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}
- name: Upload artifact (Horizon OS)
if: matrix.target == 'editor'
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}-horizonos
path: horizonos
- name: Upload artifact (PICO OS)
if: matrix.target == 'editor'
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}-picoos
path: picoos
- name: Generate Instrumented test APKs
if: matrix.instrumented_tests && github.repository == 'godotengine/godot' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
run: |
cd platform/android/java
if [ "${{ matrix.target }}" = "editor" ]; then
./gradlew :editor:assembleAndroidAndroidTest :editor:assembleAndroidDebug -Pperform_signing=true
else
./gradlew :app:assembleAndroidTest :app:assembleInstrumentedDebug -Pperform_signing=true
fi
cd ../../..
- name: Create credentials file
if: matrix.instrumented_tests && github.repository == 'godotengine/godot' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
- name: Set up gcloud CLI
if: matrix.instrumented_tests && github.repository == 'godotengine/godot' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
uses: google-github-actions/setup-gcloud@v3
- name: Run tests on Firebase Test Lab
if: matrix.instrumented_tests && github.repository == 'godotengine/godot' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
run: |
set +e
if [ "${{ matrix.target }}" = "editor" ]; then
APP_APK="platform/android/java/editor/build/outputs/apk/android/debug/android_editor-android-debug.apk"
TEST_APK="platform/android/java/editor/build/outputs/apk/androidTest/android/debug/android_editor-android-debug-androidTest.apk"
else
APP_APK="platform/android/java/app/build/outputs/apk/instrumented/debug/android_debug.apk"
TEST_APK="platform/android/java/app/build/outputs/apk/androidTest/instrumented/debug/app-instrumented-debug-androidTest.apk"
fi
output=$(gcloud firebase test android run \
--type instrumentation \
--app "$APP_APK" \
--test "$TEST_APK" \
--device model=MediumPhone.arm,version=26 \
--device model=starlte,version=29 \
--device model=MediumPhone.arm,version=32 \
--device model=MediumTablet.arm,version=35 \
--device model=rango,version=36 \
--use-orchestrator \
--timeout 2m 2>&1)
exit_code=$?
echo "$output"
if [[ $exit_code -eq 1 && "$output" == *"TEST_QUOTA_EXCEEDED"* ]]; then
echo "::warning title=Firebase Test Lab::Test quota exceeded."
exit_code=0
fi
exit "$exit_code"