roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.06k stars 213 forks source link

Add more Android versions to CI #390

Closed gavv closed 4 years ago

gavv commented 4 years ago

Currently our travis build uses Android NDK 21 with API level 28, which corresponds to Android 9.

It would be nice to cover other Android versions as well:

We should determine what NDK versions and API levels corresponds to these Android versions.

Then we should add missing NDK versions to cross-linux-android dockerfile: https://github.com/roc-streaming/dockerfiles/tree/master/cross-linux-android (just add a line to images.csv).

Then we should add travis scripts for corresponding NDK and API versions to https://github.com/roc-streaming/roc-toolkit/tree/develop/scripts/travis/android and call them from .travis.yml.

Finally, we should update docs:

Bwoltz commented 4 years ago

I'm not familiar with Android, but do you need to use older versions of NDK? Can't you use the latest version for all your builds and set the minimum API level (24) accordingly?

Sorry if this is a dumb question, just trying to learn. Thanks!

gavv commented 4 years ago

Hi!

Yes, using a single NDK is perfectly OK if it supports all necessary API levels.

It seems that NDK 21 supports all necessary API levels so we can use it for all of them:

$ docker run --rm -ti rocproject/cross-linux-android:ndk21 ls -1 /opt/android-ndk-r21/toolchains/llvm/prebuilt/linux-x86_64/bin | grep -F -- '-clang++' | grep '2[469]'
aarch64-linux-android24-clang++
aarch64-linux-android26-clang++
aarch64-linux-android29-clang++
armv7a-linux-androideabi24-clang++
armv7a-linux-androideabi26-clang++
armv7a-linux-androideabi29-clang++
i686-linux-android24-clang++
i686-linux-android26-clang++
i686-linux-android29-clang++
x86_64-linux-android24-clang++
x86_64-linux-android26-clang++
x86_64-linux-android29-clang++
gavv commented 4 years ago

Update: we want to switch our Android build from cross-linux-android to env-android docker image. In addition to NDK, env-android also provides SDK and android emulator. It will allow us to run unit tests under emulator on Travis, as described in #396.

So, if this issue will be started before #396, we should do the switch from cross-linux-android to env-android withing this issue.

gavv commented 4 years ago

Update 2: we've switched from rocproject/cross-linux-android to rocstreaming/env-android image in Travis builds.

This new image does not hardcode specific NDK versions; instead, NDK version and other parameters are passed to it at runtime via environment variables.

Since apparently NDK 21 provides all necessary API levels, all we need to to now is:

gavv commented 4 years ago

Update 3: we've added documentation for env-android image: https://github.com/roc-streaming/roc-toolkit/blob/develop/docs/sphinx/development/continuous_integration.rst#android-environment

MatteoArella commented 4 years ago

I can work on this :)

gavv commented 4 years ago

Great!

gavv commented 4 years ago

Merged.