From b834ab14b316d37585f9fd294e1fbf7ee27d823b Mon Sep 17 00:00:00 2001 From: TimPushkin Date: Thu, 19 May 2022 13:40:00 +0300 Subject: [PATCH] Put Android lib and app building into a single job --- .github/workflows/android.yml | 57 +++-------------------------------- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index fe8287b..2b93975 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -57,7 +57,7 @@ jobs: path: | ~/.cmodule ${{github.workspace}}/${{env.NATIVE_PROJECT_SUBDIR}}/${{env.BUILD_SUBDIR}} - key: ${{runner.os}}-native-build-cache-lib + key: ${{runner.os}}-native-build-cache - name: Prepare OpenCV env: @@ -82,57 +82,8 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Build with Gradle + - name: Build Android library run: ./gradlew :sgbmandroid:build - build-app: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: 'gradle' - - - uses: nttld/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r23b - add-to-path: false - - - name: Cache native-build-related files - uses: actions/cache@v3 - with: - path: | - ~/.cmodule - ${{github.workspace}}/${{env.NATIVE_PROJECT_SUBDIR}}/${{env.BUILD_SUBDIR}} - key: ${{runner.os}}-native-build-cache-app - - - name: Prepare OpenCV - env: - NDK: ${{steps.setup-ndk.outputs.ndk-path}} - working-directory: ${{env.NATIVE_PROJECT_SUBDIR}} - run: | - for ABI in $ABIS; do - if [ ! -f "${{env.BUILD_SUBDIR}}/opencv-build-$ABI/OpenCVConfig.cmake" ]; then - echo "Preparing OpenCV for $ABI" - cmake -D CMAKE_TOOLCHAIN_FILE="$NDK/$TOOLCHAIN_SUBPATH" \ - -D CMAKE_C_COMPILER="$NDK/$C_COMPILER_SUBPATH" \ - -D CMAKE_CXX_COMPILER="$NDK/$CXX_COMPILER_SUBPATH" \ - -D ANDROID_ABI=$ABI \ - -D BUILD_DIR_SUFFIX=$ABI \ - -D ADD_ANDROID_ABI_CHECK=ON \ - -P BuildOpenCV.cmake - else - echo "OpenCV for $ABI already prepared" - fi - done - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Build with Gradle - run: ./gradlew :sgbmandroid:build :app:build + - name: Build Android app + run: ./gradlew :app:build