mirror of https://github.com/c-ares/c-ares.git
CI: Add Android automated building with GitHub Actions (#843)
Authored-By: Brad House (@bradh352)pull/846/head
parent
d693951067
commit
4f2f3427e8
2 changed files with 84 additions and 1 deletions
@ -0,0 +1,73 @@ |
||||
# Copyright (C) The c-ares project and its contributors |
||||
# SPDX-License-Identifier: MIT |
||||
name: Android |
||||
on: |
||||
push: |
||||
pull_request: |
||||
|
||||
concurrency: |
||||
group: ${{ github.ref }}-android |
||||
cancel-in-progress: true |
||||
|
||||
env: |
||||
CMAKE_DEFAULT_FLAGS: "-DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -G Ninja -DANDROID_PLATFORM=android-26" |
||||
MAKE: make |
||||
|
||||
jobs: |
||||
build: |
||||
runs-on: ubuntu-latest |
||||
name: "Android" |
||||
steps: |
||||
- name: Install packages |
||||
uses: awalsh128/cache-apt-pkgs-action@latest |
||||
with: |
||||
packages: cmake ninja-build autoconf automake libtool pkg-config |
||||
version: 1.0 |
||||
- name: Checkout c-ares |
||||
uses: actions/checkout@v4 |
||||
- name: Setup NDK |
||||
uses: nttld/setup-ndk@v1 |
||||
id: setup-ndk |
||||
with: |
||||
ndk-version: r21e |
||||
add-to-path: false |
||||
- name: "CMake: armeabi-v7a build c-ares" |
||||
env: |
||||
BUILD_TYPE: CMAKE |
||||
CMAKE_FLAGS: "${{ env.CMAKE_DEFAULT_FLAGS }} -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake" |
||||
run: | |
||||
./ci/build.sh |
||||
- name: "CMake: arm64-v8a build c-ares" |
||||
env: |
||||
BUILD_TYPE: CMAKE |
||||
CMAKE_FLAGS: "${{ env.CMAKE_DEFAULT_FLAGS }} -DANDROID_ABI=arm64-v8a -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake" |
||||
run: | |
||||
./ci/build.sh |
||||
- name: "CMake: x86 build c-ares" |
||||
env: |
||||
BUILD_TYPE: CMAKE |
||||
CMAKE_FLAGS: "${{ env.CMAKE_DEFAULT_FLAGS }} -DANDROID_ABI=x86 -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake" |
||||
run: | |
||||
./ci/build.sh |
||||
- name: "CMake: x86_64 build c-ares" |
||||
env: |
||||
BUILD_TYPE: CMAKE |
||||
CMAKE_FLAGS: "${{ env.CMAKE_DEFAULT_FLAGS }} -DANDROID_ABI=x86_64 -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake" |
||||
run: | |
||||
./ci/build.sh |
||||
- name: "Autotools: aarch64 build c-ares" |
||||
env: |
||||
BUILD_TYPE: autotools |
||||
TOOLCHAIN: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64" |
||||
TARGET: aarch64-linux-android |
||||
API: 26 |
||||
AR: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" |
||||
CC: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-linux-android26" |
||||
AS: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-linux-android26" |
||||
CXX: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-linux-android26" |
||||
LD: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/ld" |
||||
RANLIB: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" |
||||
STRIP: "${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip" |
||||
CONFIG_OPTS: "--host aarch64-linux-android --disable-shared" |
||||
run: | |
||||
./ci/build.sh |
Loading…
Reference in new issue