Skip to content

feat: add zoom ratio API (setZoomRatio) to ICameraProvider #79

feat: add zoom ratio API (setZoomRatio) to ICameraProvider

feat: add zoom ratio API (setZoomRatio) to ICameraProvider #79

Workflow file for this run

name: macOS Build
on:
push:
branches:
- "master"
- "test_workflow*"
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
name: "${{ matrix.os-name }} | NDK-${{ matrix.ndk }} | ${{ matrix.build-system }} | ${{ matrix.ffmpeg }} | ${{ matrix.page-size }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(github.event_name == 'pull_request' && '[{"os":"macos-latest","os-name":"macOS","ndk":"r29","build-system":"ndk-build","ffmpeg":"no-ffmpeg","page-size":"4kb"}]' || '[{"os":"macos-latest","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r27c","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"16kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r29","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r29","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r29","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"macos-latest","os-name":"macOS","ndk":"r29","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"16kb"}]') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install NDK
shell: bash
run: |
NDK_FLAVOR="${{ matrix.ndk }}"
NDK_FLAVOR=$(printf "%s" "$NDK_FLAVOR" | tr -d '\r\n')
case "$NDK_FLAVOR" in
r29*) NDK_VERSION="29.0.14206865" ;;
r27c*) NDK_VERSION="27.2.12479018" ;;
*)
echo "Error: Unsupported NDK version $NDK_FLAVOR"
exit 1
;;
esac
set +o pipefail
yes | sdkmanager "ndk;${NDK_VERSION}"
SDKMANAGER_STATUS=${PIPESTATUS[1]}
set -o pipefail
if [ "$SDKMANAGER_STATUS" -ne 0 ]; then
echo "Error: sdkmanager failed with status $SDKMANAGER_STATUS"
exit "$SDKMANAGER_STATUS"
fi
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}" >> "$GITHUB_ENV"
echo "$ANDROID_SDK_ROOT/ndk/${NDK_VERSION}" >> "$GITHUB_PATH"
- name: Install build tools
run: brew install ninja
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for scripts
run: chmod +x gradlew tasks.sh
- name: Configure build parameters
shell: bash
run: |
# Set build system flag
if [ "${{ matrix.build-system }}" == "cmake" ]; then
echo "BUILD_SYSTEM_FLAG=--enable-cmake" >> $GITHUB_ENV
else
echo "BUILD_SYSTEM_FLAG=" >> $GITHUB_ENV
fi
# Set FFmpeg flag
if [ "${{ matrix.ffmpeg }}" == "with-ffmpeg" ]; then
echo "FFMPEG_FLAG=--enable-video-module" >> $GITHUB_ENV
else
echo "FFMPEG_FLAG=--disable-video-module" >> $GITHUB_ENV
fi
# Set page size flag
if [ "${{ matrix.page-size }}" == "16kb" ]; then
echo "PAGE_SIZE_FLAG=--enable-16kb-page-size" >> $GITHUB_ENV
else
echo "PAGE_SIZE_FLAG=--disable-16kb-page-size" >> $GITHUB_ENV
fi
# Set artifact name
OS_SHORT="${{ runner.os }}"
NDK_SHORT="${{ matrix.ndk }}"
BUILD_SYS="${{ matrix.build-system }}"
if [ "${{ matrix.ffmpeg }}" == "with-ffmpeg" ]; then
FFMPEG_SHORT="ffmpeg"
else
FFMPEG_SHORT="noffmpeg"
fi
PAGE_SHORT="${{ matrix.page-size }}"
echo "ARTIFACT_NAME=apk-${OS_SHORT}-${NDK_SHORT}-${BUILD_SYS}-${FFMPEG_SHORT}-${PAGE_SHORT}" >> $GITHUB_ENV
- name: Setup project (ndk-build mode)
if: matrix.build-system == 'ndk-build'
shell: bash
run: ./tasks.sh --setup-project
- name: Build APK
shell: bash
run: ./tasks.sh --release $BUILD_SYSTEM_FLAG $FFMPEG_FLAG $PAGE_SIZE_FLAG --build
- name: Find and rename APK
shell: bash
run: |
APK_FILE=$(find "cgeDemo/build" -name "*.apk" | grep -i release | head -n 1)
if [ -z "$APK_FILE" ]; then
echo "Error: No release APK found in cgeDemo/build"
exit 1
fi
mkdir -p artifacts
cp "$APK_FILE" "artifacts/cgeDemo-${{ env.ARTIFACT_NAME }}.apk"
echo "APK saved as: artifacts/cgeDemo-${{ env.ARTIFACT_NAME }}.apk"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifacts/*.apk
compression-level: 0
retention-days: 15
if-no-files-found: error