feat: Implement CameraX support with runtime camera API selection #68
Workflow file for this run
This file contains hidden or 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: Windows 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":"windows-latest","os-name":"Windows","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"}]' || '[{"os":"windows-latest","os-name":"Windows","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r27c","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r27c","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r27c","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"16kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r29","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"4kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r29","build-system":"cmake","ffmpeg":"with-ffmpeg","page-size":"16kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r29","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"4kb"},{"os":"windows-latest","os-name":"Windows","ndk":"r29","build-system":"cmake","ffmpeg":"no-ffmpeg","page-size":"16kb"}]') }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup NDK | |
| uses: nttld/setup-ndk@v1.4.2 | |
| id: setup-ndk | |
| with: | |
| ndk-version: ${{ matrix.ndk }} | |
| link-to-sdk: true | |
| add-to-path: true | |
| - name: Install build tools | |
| run: choco install ninja -y | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - 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: bash tasks.sh --setup-project | |
| - name: Build APK | |
| shell: bash | |
| run: bash 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 | |