Merge pull request #6 from vishnunandan555/master #9
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: Build and Test | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| APP_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v4 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Accept Android SDK licenses | |
| run: yes | sdkmanager --licenses || true | |
| - name: Test, lint, and build Android APK | |
| run: >- | |
| ./gradlew | |
| :shared:jvmTest | |
| :androidApp:testDebugUnitTest | |
| :androidApp:lintDebug | |
| :androidApp:assembleDebug | |
| - name: Upload APK Artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ogh-debug-apk | |
| path: androidApp/build/outputs/apk/debug/*.apk | |
| if-no-files-found: error | |
| maestro: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| env: | |
| MAESTRO_VERSION: 2.6.1 | |
| MAESTRO_CLI_NO_ANALYTICS: "1" | |
| MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: "true" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Enable KVM | |
| run: | | |
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
| sudo udevadm control --reload-rules | |
| sudo udevadm trigger --name-match=kvm | |
| - name: Set up Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: '17' | |
| - name: Download tested APK | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: ogh-debug-apk | |
| path: androidApp/build/outputs/apk/debug | |
| - name: Install pinned Maestro CLI | |
| run: | | |
| curl --fail --location --silent --show-error --output maestro.zip \ | |
| "https://github.com/mobile-dev-inc/Maestro/releases/download/cli-${MAESTRO_VERSION}/maestro.zip" | |
| echo "3440825f514f537c6a96bcf5de995780c2a4a7f83a43208fdc95d4f1fecfad3b maestro.zip" | sha256sum --check | |
| unzip -q maestro.zip -d "$RUNNER_TEMP/maestro" | |
| echo "$RUNNER_TEMP/maestro/maestro/bin" >> "$GITHUB_PATH" | |
| - name: Run Maestro end-to-end suite | |
| uses: reactivecircus/android-emulator-runner@v2.37.0 | |
| with: | |
| api-level: 35 | |
| arch: x86_64 | |
| target: google_apis | |
| emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back emulated | |
| disable-animations: true | |
| script: | | |
| adb install -r androidApp/build/outputs/apk/debug/androidApp-debug.apk | |
| maestro test .maestro | |
| - name: Upload Maestro diagnostics | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: maestro-report | |
| path: build/reports/maestro | |
| if-no-files-found: ignore |