Skip to content

Android build

Android build #8

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Android build
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
arch: [ "arm64-v8a", "armeabi-v7a", "x86", "x86_64" ]
fail-fast: false
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a set of commands using the runners shell
- name: "Build shaderc for Android ${{matrix.arch}}"
run: |
./utils/git-sync-deps
# Workaround a cmake bug
sed -i'' -e 's/android log/android -llog/g' third_party/spirv-tools/source/CMakeLists.txt
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DANDROID_PLATFORM=24 -DANDROID_ABI=${{matrix.arch}} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DSHADERC_SKIP_TESTS=1
cmake --build build --clean-first -- -j8
cd build/libshaderc
cp libshaderc_shared.so libshaderc.so
$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip libshaderc.so
# | echo "Build exit code: $?"
# --verbose
- name: Upload libshaderc
uses: actions/upload-artifact@v2
with:
name: libshaderc-${{matrix.arch}}
path: build/libshaderc/libshaderc.so
- name: Upload libshaderc (with debug info)
uses: actions/upload-artifact@v2
with:
name: libshaderc-${{matrix.arch}}-debug
path: build/libshaderc/libshaderc_shared.so