1515 runs-on : ubuntu-latest
1616 steps :
1717 - name : Checkout python-for-android
18- uses : actions/checkout@v2
18+ uses : actions/checkout@v3
1919 - name : Set up Python 3.x
20- uses : actions/setup-python@v2
20+ uses : actions/setup-python@v4
2121 with :
2222 python-version : 3.x
2323 - name : Run flake8
@@ -32,13 +32,13 @@ jobs:
3232 runs-on : ${{ matrix.os }}
3333 strategy :
3434 matrix :
35- python-version : ['3.7 ', '3.8 ', '3.9 ', '3.10 ']
35+ python-version : ['3.8 ', '3.9 ', '3.10 ', '3.11 ']
3636 os : [ubuntu-latest, macOs-latest]
3737 steps :
3838 - name : Checkout python-for-android
39- uses : actions/checkout@v2
39+ uses : actions/checkout@v3
4040 - name : Set up Python ${{ matrix.python-version }}
41- uses : actions/setup-python@v2
41+ uses : actions/setup-python@v4
4242 with :
4343 python-version : ${{ matrix.python-version }}
4444 - name : Tox tests
5353 parallel : true
5454 flag-name : run-${{ matrix.os }}-${{ matrix.python-version }}
5555
56- ubuntu_build_apk :
57- name : Unit test apk [ ${{ matrix.runs_on }} | ${{ matrix.bootstrap.name }} ]
56+ ubuntu_build :
57+ name : Build test APP [ ${{ matrix.runs_on }} | ${{ matrix.bootstrap.name }} ]
5858 needs : [flake8]
5959 runs-on : ${{ matrix.runs_on }}
6060 continue-on-error : true
@@ -68,36 +68,41 @@ jobs:
6868 target : testapps-with-scipy
6969 - name : webview
7070 target : testapps-webview
71+ - name : service_library
72+ target : testapps-service_library-aar
7173 steps :
7274 - name : Checkout python-for-android
73- uses : actions/checkout@v2
74- # helps with GitHub runner getting out of space
75- - name : Free disk space
76- run : |
77- df -h
78- sudo swapoff -a
79- sudo rm -f /swapfile
80- sudo apt -y clean
81- docker rmi $(docker image ls -aq)
82- df -h
83- - name : Pull docker image
84- run : |
85- make docker/pull
86- - name : Build multi-arch apk Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
87- run : |
88- mkdir -p apks
89- make docker/run/make/with-artifact/apk/${{ matrix.bootstrap.target }}
90- - name : Rename apk artifact to include the build platform name
91- run : |
92- mv apks/${{ env.APK_ARTIFACT_FILENAME }} apks/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}
93- - name : Upload apk artifact
94- uses : actions/upload-artifact@v1
75+ uses : actions/checkout@v3
76+ - name : Build python-for-android docker image
77+ run : |
78+ docker build --tag=kivy/python-for-android .
79+ - name : Build multi-arch ${{ matrix.bootstrap.target }} artifact with docker
80+ run : |
81+ docker run --name p4a-latest kivy/python-for-android make ${{ matrix.bootstrap.target }}
82+ - name : Copy produced artifacts from docker container (*.apk, *.aab)
83+ if : matrix.bootstrap.name != 'service_library'
84+ run : |
85+ mkdir -p dist
86+ docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/${{ env.APK_ARTIFACT_FILENAME }} dist/
87+ docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/${{ env.AAB_ARTIFACT_FILENAME }} dist/
88+ - name : Copy produced artifacts from docker container (*.aar)
89+ if : matrix.bootstrap.name == 'service_library'
90+ run : |
91+ mkdir -p dist
92+ docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/${{ env.AAR_ARTIFACT_FILENAME }} dist/
93+ - name : Rename artifacts to include the build platform name (*.apk, *.aab, *.aar)
94+ run : |
95+ if [ -f dist/${{ env.APK_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.APK_ARTIFACT_FILENAME }} dist/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}; fi
96+ if [ -f dist/${{ env.AAB_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.AAB_ARTIFACT_FILENAME }} dist/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.AAB_ARTIFACT_FILENAME }}; fi
97+ if [ -f dist/${{ env.AAR_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.AAR_ARTIFACT_FILENAME }} dist/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.AAR_ARTIFACT_FILENAME }}; fi
98+ - name : Upload artifacts
99+ uses : actions/upload-artifact@v3
95100 with :
96- name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}
97- path : apks/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}
101+ name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-artifacts
102+ path : dist
98103
99- macos_build_apk :
100- name : Unit test apk [ ${{ matrix.runs_on }} | ${{ matrix.bootstrap.name }} ]
104+ macos_build :
105+ name : Build test APP [ ${{ matrix.runs_on }} | ${{ matrix.bootstrap.name }} ]
101106 needs : [flake8]
102107 runs-on : ${{ matrix.runs_on }}
103108 continue-on-error : true
@@ -116,7 +121,7 @@ jobs:
116121 ANDROID_NDK_HOME : ${HOME}/.android/android-ndk
117122 steps :
118123 - name : Checkout python-for-android
119- uses : actions/checkout@v2
124+ uses : actions/checkout@v3
120125 - name : Install python-for-android
121126 run : |
122127 source ci/osx_ci.sh
@@ -137,146 +142,21 @@ jobs:
137142 source ci/osx_ci.sh
138143 arm64_set_path_and_python_version 3.9.7
139144 make ${{ matrix.bootstrap.target }}
140- - name : Rename apk artifact to include the build platform name
145+ - name : Copy produced artifacts into dist/ (*.apk, *.aab)
141146 run : |
142- mv testapps/on_device_unit_tests/${{ env.APK_ARTIFACT_FILENAME }} ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}
143- - name : Upload apk artifact
144- uses : actions/upload-artifact@v1
145- with :
146- name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}
147- path : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}
148-
149- ubuntu_build_aab :
150- name : Unit test aab [ ${{ matrix.runs_on }} ]
151- needs : [flake8]
152- runs-on : ${{ matrix.runs_on }}
153- continue-on-error : true
154- strategy :
155- matrix :
156- runs_on : [ubuntu-latest]
157- bootstrap :
158- - name : sdl2
159- target : testapps-with-numpy-aab
160- - name : webview
161- target : testapps-webview-aab
162- steps :
163- - name : Checkout python-for-android
164- uses : actions/checkout@v2
165- # helps with GitHub runner getting out of space
166- - name : Free disk space
167- run : |
168- df -h
169- sudo swapoff -a
170- sudo rm -f /swapfile
171- sudo apt -y clean
172- docker rmi $(docker image ls -aq)
173- df -h
174- - name : Pull docker image
175- run : |
176- make docker/pull
177- - name : Build Android App Bundle Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
178- run : |
179- mkdir -p aabs
180- make docker/run/make/with-artifact/aab/${{ matrix.bootstrap.target }}
181- - name : Rename artifact to include the build platform name
182- run : |
183- mv aabs/${{ env.AAB_ARTIFACT_FILENAME }} aabs/${{ matrix.runs_on }}-${{ matrix.bootstrap.name}}-${{ env.AAB_ARTIFACT_FILENAME }}
184- - name : Upload apk artifact
185- uses : actions/upload-artifact@v1
186- with :
187- name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name}}-${{ env.AAB_ARTIFACT_FILENAME }}
188- path : aabs/${{ matrix.runs_on }}-${{ matrix.bootstrap.name}}-${{ env.AAB_ARTIFACT_FILENAME }}
189-
190-
191- ubuntu_build_aar :
192- name : Unit test aar [ ${{ matrix.runs_on }} ]
193- needs : [flake8]
194- runs-on : ${{ matrix.runs_on }}
195- continue-on-error : true
196- strategy :
197- matrix :
198- runs_on : [ubuntu-latest]
199- bootstrap :
200- - name : service_library
201- target : testapps-service_library-aar
202- steps :
203- - name : Checkout python-for-android
204- uses : actions/checkout@v2
205- # helps with GitHub runner getting out of space
206- - name : Free disk space
207- run : |
208- df -h
209- sudo swapoff -a
210- sudo rm -f /swapfile
211- sudo apt -y clean
212- docker rmi $(docker image ls -aq)
213- df -h
214- - name : Pull docker image
215- run : |
216- make docker/pull
217- - name : Build Android AAR Python 3 (arm64-v8a)
218- run : |
219- mkdir -p aars
220- make docker/run/make/with-artifact/aar/${{ matrix.bootstrap.target }}
221- - name : Rename artifact to include the build platform name
222- run : |
223- mv aars/${{ env.AAR_ARTIFACT_FILENAME }} aars/${{ matrix.runs_on }}-${{ matrix.bootstrap.name}}-${{ env.AAR_ARTIFACT_FILENAME }}
224- - name : Upload aar artifact
225- uses : actions/upload-artifact@v1
226- with :
227- name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name}}-${{ env.AAR_ARTIFACT_FILENAME }}
228- path : aars/${{ matrix.runs_on }}-${{ matrix.bootstrap.name}}-${{ env.AAR_ARTIFACT_FILENAME }}
229-
230-
231- macos_build_aab :
232- name : Unit test aab [ ${{ matrix.runs_on }} | ${{ matrix.bootstrap.name }} ]
233- needs : [flake8]
234- runs-on : ${{ matrix.runs_on }}
235- continue-on-error : true
236- strategy :
237- matrix :
238- runs_on : [macos-latest, apple-silicon-m1]
239- bootstrap :
240- - name : sdl2
241- target : testapps-with-numpy-aab
242- - name : webview
243- target : testapps-webview-aab
244- env :
245- ANDROID_HOME : ${HOME}/.android
246- ANDROID_SDK_ROOT : ${HOME}/.android/android-sdk
247- ANDROID_SDK_HOME : ${HOME}/.android/android-sdk
248- ANDROID_NDK_HOME : ${HOME}/.android/android-ndk
249- steps :
250- - name : Checkout python-for-android
251- uses : actions/checkout@v2
252- - name : Install python-for-android
147+ mkdir -p dist
148+ cp testapps/on_device_unit_tests/*.apk dist/
149+ cp testapps/on_device_unit_tests/*.aab dist/
150+ ls -l dist/
151+ - name : Rename artifacts to include the build platform name (*.apk, *.aab)
253152 run : |
254- source ci/osx_ci.sh
255- arm64_set_path_and_python_version 3.9.7
256- python3 -m pip install -e .
257- - name : Install prerequisites via pythonforandroid/prerequisites.py (Experimental)
258- run : |
259- source ci/osx_ci.sh
260- arm64_set_path_and_python_version 3.9.7
261- python3 pythonforandroid/prerequisites.py
262- - name : Install dependencies (Legacy)
263- run : |
264- source ci/osx_ci.sh
265- arm64_set_path_and_python_version 3.9.7
266- make --file ci/makefiles/osx.mk
267- - name : Build multi-arch sdl2 aab Python 3 (armeabi-v7a, arm64-v8a, x86_64, x86)
268- run : |
269- source ci/osx_ci.sh
270- arm64_set_path_and_python_version 3.9.7
271- make ${{ matrix.bootstrap.target }}
272- - name : Rename sdl2 artifact to include the build platform name
273- run : |
274- mv testapps/on_device_unit_tests/${{ env.AAB_ARTIFACT_FILENAME }} ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.AAB_ARTIFACT_FILENAME }}
275- - name : Upload sdl2 apk artifact
276- uses : actions/upload-artifact@v1
153+ if [ -f dist/${{ env.APK_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.APK_ARTIFACT_FILENAME }} dist/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.APK_ARTIFACT_FILENAME }}; fi
154+ if [ -f dist/${{ env.AAB_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.AAB_ARTIFACT_FILENAME }} dist/${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.AAB_ARTIFACT_FILENAME }}; fi
155+ - name : Upload artifacts
156+ uses : actions/upload-artifact@v3
277157 with :
278- name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.AAB_ARTIFACT_FILENAME }}
279- path : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-${{ env.AAB_ARTIFACT_FILENAME }}
158+ name : ${{ matrix.runs_on }}-${{ matrix.bootstrap.name }}-artifacts
159+ path : dist
280160
281161 ubuntu_rebuild_updated_recipes :
282162 name : Test updated recipes for arch ${{ matrix.android_arch }} [ ubuntu-latest ]
@@ -289,8 +169,8 @@ jobs:
289169 env :
290170 REBUILD_UPDATED_RECIPES_EXTRA_ARGS : --arch=${{ matrix.android_arch }}
291171 steps :
292- - name : Checkout python-for-android
293- uses : actions/checkout@v2
172+ - name : Checkout python-for-android (all-history)
173+ uses : actions/checkout@v3
294174 with :
295175 fetch-depth : 0
296176 # helps with GitHub runner getting out of space
@@ -325,8 +205,8 @@ jobs:
325205 ANDROID_NDK_HOME : ${HOME}/.android/android-ndk
326206 REBUILD_UPDATED_RECIPES_EXTRA_ARGS : --arch=${{ matrix.android_arch }}
327207 steps :
328- - name : Checkout python-for-android
329- uses : actions/checkout@v2
208+ - name : Checkout python-for-android (all-history)
209+ uses : actions/checkout@v3
330210 with :
331211 fetch-depth : 0
332212 - name : Install python-for-android
0 commit comments