Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci android #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/meson-android-aarch64.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[binaries]
c = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang'
cpp = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang++'
strip = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip'
pkgconfig = '/usr/bin/pkg-config'

[host_machine]
system = 'android'
cpu_family = 'arm'
cpu = 'aarch64'
endian = 'little'
11 changes: 11 additions & 0 deletions .github/meson-android-arm.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[binaries]
c = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi28-clang'
cpp = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi28-clang++'
strip = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip'
pkgconfig = '/usr/bin/pkg-config'

[host_machine]
system = 'android'
cpu_family = 'arm'
cpu = 'arm'
endian = 'little'
12 changes: 12 additions & 0 deletions .github/meson-android-x86_64.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[binaries]
c = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android28-clang'
cpp = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android28-clang++'
strip = '/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android-strip'

pkgconfig = '/usr/bin/pkg-config'

[host_machine]
system = 'android'
cpu_family = 'x86'
cpu = 'x86_64'
endian = 'little'
79 changes: 79 additions & 0 deletions .github/workflows/ci_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Warning: this name must stay in sync with the badges referenced in the README
name: 'build Android 🤖'

on:
push:
branches:
- 'master'
pull_request:

jobs:
android-build:

runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm, aarch64]
ffmpeg_version: ["4.4"]

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install ninja-build nasm
pip install --user meson

- name: Get ffmpeg source code
run: |
wget https://ffmpeg.org/releases/ffmpeg-${{ matrix.ffmpeg_version }}.tar.xz
tar -xf ffmpeg-${{ matrix.ffmpeg_version }}.tar.xz

- name: Compile ffmpeg source with the ndk toolchain for Android & install it to a specific directory
run: |
cd ffmpeg-${{ matrix.ffmpeg_version }}
android_suffix="android"
compiler=${{ matrix.arch }}

if [ ${{ matrix.arch }} == "arm" ]; then
android_suffix="androideabi"
compiler="armv7a"
fi

NDK_BIN_PATH=/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
./configure \
--disable-everything --disable-doc --disable-static --disable-autodetect --disable-programs \
--enable-shared --enable-cross-compile --enable-jni --enable-mediacodec --enable-hwaccels \
--enable-avdevice --enable-swresample --enable-rdft \
--arch=${{ matrix.arch }} --target-os=android \
--cross-prefix=$NDK_BIN_PATH/${{ matrix.arch }}-linux-${android_suffix}- \
--cc=$NDK_BIN_PATH/${compiler}-linux-${android_suffix}28-clang \
--prefix=$HOME/ffmpeg-install-${{ matrix.arch }}

make install -j$(($(nproc)+1))

- name: Build sxplayer lib for Android & reshape tree files
run: |
git clone --depth 1 https://github.com/Stupeflix/sxplayer
cd sxplayer

PKG_CONFIG_LIBDIR=$HOME/ffmpeg-install-${{ matrix.arch }}/lib/pkgconfig/ \
meson setup --prefix $HOME/usr/local --cross-file .github/meson-android-${{ matrix.arch }}.ini builddir
meson install -C builddir
meson compile -C builddir -v

- name: Build nodegl lib for Android
run: |
cd libnodegl
PKG_CONFIG_LIBDIR=$HOME/ffmpeg-install-${{ matrix.arch }}/lib/pkgconfig/:$HOME/usr/local/lib/pkgconfig/ \
meson setup --cross-file ../.github/meson-android-${{ matrix.arch }}.ini builddir
meson test -C builddir -v

- name: Upload Logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: android-logs
path: builddir/meson-logs/testlog.txt
31 changes: 0 additions & 31 deletions .github/workflows/ci_coverage.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/ci_linux.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/ci_mac.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/ci_mingw.yml

This file was deleted.

81 changes: 0 additions & 81 deletions .github/workflows/ci_msvc.yml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and API can change at any time.
![tests MinGW](https://github.com/gopro/gopro-lib-node.gl/workflows/tests%20MinGW/badge.svg)
![tests MSVC](https://github.com/gopro/gopro-lib-node.gl/workflows/tests%20MSVC/badge.svg)
[![coverage](https://codecov.io/gh/gopro/gopro-lib-node.gl/branch/master/graph/badge.svg)](https://codecov.io/gh/gopro/gopro-lib-node.gl)
![build Android 🤖](https://github.com/stupeflix/sxplayer/workflows/build%20Android%20🤖/badge.svg)

[gopro]: https://gopro.com/

Expand Down