Skip to content

github-action: more features from TAOS-CI imported and expanded #2

github-action: more features from TAOS-CI imported and expanded

github-action: more features from TAOS-CI imported and expanded #2

Workflow file for this run

name: Android NDK build
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25b
- name: Check if rebuild required
## @todo This should become a reusable workflow.
run: |
tmpfile=$(mktemp)
git show --pretty="format:" --name-only --diff-filter=AMRC ${{ github.event.pull_request.head.sha}} -${{ github.event.pull_request.commits }} | sort | uniq | awk NF > ${tmpfile}
echo "changed_file_list=${tmpfile}" >> "$GITHUB_ENV"
rebuild=`bash .github/workflows/check_if_rebuild_requires.sh ${tmpfile} android | grep "REBUILD=YES" | wc -l`
echo "Rebuild required: ${rebuild}"
echo "rebuild=${rebuild}" >> "$GITHUB_ENV"
- name: NDK Build
if: env.rebuild == '1'
runs: |
ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./jni/Android.mk NDK_APPLICATION_MK=./jni/Application.m