ci(android): add pipelines with BrowserStack integration #21
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: Android CPP CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'android-cpp/**' | |
| - '.github/workflows/android-cpp-ci.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'android-cpp/**' | |
| - '.github/workflows/android-cpp-ci.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint (ubuntu-latest) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Android SDK | |
| uses: ./.github/actions/android-sdk-setup | |
| - name: Setup NDK | |
| run: | | |
| echo "y" | sdkmanager "ndk;26.1.10909125" | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/26.1.10909125" >> $GITHUB_ENV | |
| - name: Setup Ditto Environment | |
| uses: ./.github/actions/ditto-env-setup | |
| - name: Cache Gradle | |
| uses: ./.github/actions/gradle-cache | |
| - name: Run linting | |
| working-directory: android-cpp/QuickStartTasksCPP | |
| run: ./gradlew lintDebug | |
| test: | |
| name: Unit Tests (ubuntu-latest) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Android SDK | |
| uses: ./.github/actions/android-sdk-setup | |
| - name: Setup NDK | |
| run: | | |
| echo "y" | sdkmanager "ndk;26.1.10909125" | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/26.1.10909125" >> $GITHUB_ENV | |
| - name: Setup Ditto Environment | |
| uses: ./.github/actions/ditto-env-setup | |
| - name: Cache Gradle | |
| uses: ./.github/actions/gradle-cache | |
| - name: Run unit tests | |
| working-directory: android-cpp/QuickStartTasksCPP | |
| run: ./gradlew test | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-cpp-test-results | |
| path: | | |
| android-cpp/QuickStartTasksCPP/app/build/reports/tests/ | |
| android-cpp/QuickStartTasksCPP/app/build/test-results/ | |
| build-debug: | |
| name: Build Debug APK (ubuntu-latest) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Android SDK | |
| uses: ./.github/actions/android-sdk-setup | |
| - name: Setup NDK | |
| run: | | |
| echo "y" | sdkmanager "ndk;26.1.10909125" | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/26.1.10909125" >> $GITHUB_ENV | |
| - name: Setup Ditto Environment | |
| uses: ./.github/actions/ditto-env-setup | |
| with: | |
| use-secrets: 'true' | |
| ditto-app-id: ${{ secrets.DITTO_APP_ID }} | |
| ditto-playground-token: ${{ secrets.DITTO_PLAYGROUND_TOKEN }} | |
| ditto-auth-url: ${{ secrets.DITTO_AUTH_URL }} | |
| ditto-websocket-url: ${{ secrets.DITTO_WEBSOCKET_URL }} | |
| - name: Cache Gradle | |
| uses: ./.github/actions/gradle-cache | |
| - name: Build Android Debug APK | |
| working-directory: android-cpp/QuickStartTasksCPP | |
| run: ./gradlew assembleDebug | |
| - name: Upload APK artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-cpp-debug-apk | |
| path: android-cpp/QuickStartTasksCPP/app/build/outputs/apk/debug/app-debug.apk | |
| build-test-apk: | |
| name: Build Test APK (ubuntu-latest) | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Android SDK | |
| uses: ./.github/actions/android-sdk-setup | |
| - name: Setup NDK | |
| run: | | |
| echo "y" | sdkmanager "ndk;26.1.10909125" | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/26.1.10909125" >> $GITHUB_ENV | |
| - name: Setup Ditto Environment | |
| uses: ./.github/actions/ditto-env-setup | |
| with: | |
| use-secrets: 'true' | |
| ditto-app-id: ${{ secrets.DITTO_APP_ID }} | |
| ditto-playground-token: ${{ secrets.DITTO_PLAYGROUND_TOKEN }} | |
| ditto-auth-url: ${{ secrets.DITTO_AUTH_URL }} | |
| ditto-websocket-url: ${{ secrets.DITTO_WEBSOCKET_URL }} | |
| - name: Cache Gradle | |
| uses: ./.github/actions/gradle-cache | |
| - name: Build Android Test APK | |
| working-directory: android-cpp/QuickStartTasksCPP | |
| run: ./gradlew assembleDebugAndroidTest | |
| - name: Upload Test APK artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-cpp-test-apk | |
| path: android-cpp/QuickStartTasksCPP/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk |