Merge pull request #241 from QBDI/Fix_arm_mov_pc #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Package Android | |
on: | |
push: | |
branches: | |
- master | |
- dev-next | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- QBDI_ARCH: 'X86_64' | |
ANDROID_ABI: 'x86_64' | |
- QBDI_ARCH: 'X86' | |
ANDROID_ABI: 'x86' | |
- QBDI_ARCH: 'AARCH64' | |
ANDROID_ABI: 'arm64-v8a' | |
- QBDI_ARCH: 'ARM' | |
ANDROID_ABI: 'armeabi-v7a' | |
fail-fast: false | |
env: | |
QBDI_PLATFORM: 'android' | |
NDK_VERSION: 'r23' | |
ANDROID_PLATFORM: 23 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: Cache ccache | |
uses: actions/cache@v3 | |
id: cache-ccache | |
with: | |
path: | | |
~/.ccache | |
key: ccache-android-${{ matrix.QBDI_ARCH }}-${{ env.NDK_VERSION }}-${{ env.ANDROID_PLATFORM }}-${{ hashFiles('.github/workflows/ccache.conf') }}-${{ github.run_number }} | |
restore-keys: | | |
ccache-android-${{ matrix.QBDI_ARCH }}-${{ env.NDK_VERSION }}-${{ env.ANDROID_PLATFORM }}-${{ hashFiles('.github/workflows/ccache.conf') }}- | |
- if: steps.cache-ccache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/.ccache | |
cp .github/workflows/ccache.conf ~/.ccache/ccache.conf | |
- name: Cache android NDK ${{ env.NDK_VERSION }} | |
uses: actions/cache@v3 | |
id: cache-ndk | |
with: | |
path: | | |
android-ndk-${{ env.NDK_VERSION }}/ | |
key: ndk-${{ env.NDK_VERSION }}-linux | |
- name: Cache third-party | |
uses: actions/cache@v3 | |
with: | |
path: | | |
third-party | |
key: QBDI-third-party-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('**/*.cmake') }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential ccache cmake g++ libstdc++-10-dev make ninja-build pkg-config python3 unzip wget zlib1g-dev | |
- name: Install android NDK ${{ env.NDK_VERSION }} | |
if: steps.cache-ndk.outputs.cache-hit != 'true' | |
run: | | |
wget --no-verbose https://dl.google.com/android/repository/android-ndk-${{ env.NDK_VERSION }}-linux.zip | |
unzip -q android-ndk-${{ env.NDK_VERSION }}-linux.zip | |
rm android-ndk-${{ env.NDK_VERSION }}-linux.zip | |
- run: mkdir -p build | |
- name: Build Package | |
working-directory: ./build | |
run: | | |
cmake -DQBDI_PLATFORM=${{ env.QBDI_PLATFORM }} \ | |
-DQBDI_ARCH=${{ matrix.QBDI_ARCH }} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/android-ndk-${{ env.NDK_VERSION }}/build/cmake/android.toolchain.cmake \ | |
-DANDROID_ABI=${{ matrix.ANDROID_ABI }} \ | |
-DANDROID_PLATFORM=${{ env.ANDROID_PLATFORM }} \ | |
-DQBDI_TEST=OFF \ | |
-G Ninja \ | |
.. | |
ninja | |
cpack | |
- name: Export package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: package_android_${{ matrix.QBDI_ARCH }} | |
path: build/QBDI-*-android-${{ matrix.QBDI_ARCH }}.tar.gz | |