🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.5 KiB

  1. name: Build (Android)
  2. on: [push, pull_request]
  3. jobs:
  4. android:
  5. name: ${{ matrix.platform.name }}
  6. runs-on: ubuntu-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. platform:
  11. - { name: Android.mk }
  12. - { name: CMake, cmake: 1, android_abi: "arm64-v8a", android_platform: 23, arch: "aarch64" }
  13. steps:
  14. - uses: actions/checkout@v3
  15. - uses: nttld/setup-ndk@v1
  16. id: setup_ndk
  17. with:
  18. ndk-version: r21e
  19. - name: Build (Android.mk)
  20. if: ${{ matrix.platform.name == 'Android.mk' }}
  21. run: |
  22. ./build-scripts/androidbuildlibs.sh
  23. - name: Setup (CMake)
  24. if: ${{ matrix.platform.name == 'CMake' }}
  25. run: |
  26. sudo apt-get update
  27. sudo apt-get install ninja-build pkg-config
  28. - name: Configure (CMake)
  29. if: ${{ matrix.platform.name == 'CMake' }}
  30. run: |
  31. cmake -B build \
  32. -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
  33. -DSDL_WERROR=ON \
  34. -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
  35. -DANDROID_ABI=${{ matrix.platform.android_abi }} \
  36. -DSDL_STATIC_PIC=ON \
  37. -DSDL_VENDOR_INFO="Github Workflow" \
  38. -DCMAKE_INSTALL_PREFIX=prefix \
  39. -DCMAKE_BUILD_TYPE=Release \
  40. -GNinja
  41. - name: Build (CMake)
  42. if: ${{ matrix.platform.name == 'CMake' }}
  43. run: |
  44. cmake --build build --config Release --parallel --verbose
  45. - name: Install (CMake)
  46. if: ${{ matrix.platform.name == 'CMake' }}
  47. run: |
  48. cmake --install build --config Release
  49. echo "SDL2_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  50. ( cd prefix; find ) | LC_ALL=C sort -u
  51. - name: Verify CMake configuration files
  52. if: ${{ matrix.platform.name == 'CMake' }}
  53. run: |
  54. cmake -S cmake/test -B cmake_config_build -G Ninja \
  55. -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup_ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake \
  56. -DANDROID_PLATFORM=${{ matrix.platform.android_platform }} \
  57. -DANDROID_ABI=${{ matrix.platform.android_abi }} \
  58. -DCMAKE_BUILD_TYPE=Release \
  59. -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
  60. cmake --build cmake_config_build --verbose
  61. - name: Verify sdl2-config
  62. if: ${{ matrix.platform.name == 'CMake' }}
  63. run: |
  64. export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
  65. export PATH=${{ env.SDL2_DIR }}/bin:$PATH
  66. cmake/test/test_sdlconfig.sh
  67. - name: Verify sdl2.pc
  68. if: ${{ matrix.platform.name == 'CMake' }}
  69. run: |
  70. export CC="${{ steps.setup_ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=${{ matrix.platform.arch }}-none-linux-androideabi${{ matrix.platform.android_platform }}"
  71. export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
  72. cmake/test/test_pkgconfig.sh
  73. - name: Verify Android.mk
  74. if: ${{ matrix.platform.name == 'CMake' }}
  75. run: |
  76. export NDK_MODULE_PATH=${{ env.SDL2_DIR }}/share/ndk-modules
  77. ndk-build -C ${{ github.workspace }}/cmake/test APP_PLATFORM=android-${{ matrix.platform.android_platform }} APP_ABI=${{ matrix.platform.android_abi }} NDK_OUT=$PWD NDK_LIBS_OUT=$PWD V=1