Skip to content

Run android emulator on ubuntu build agent #802

Run android emulator on ubuntu build agent

Run android emulator on ubuntu build agent #802

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Pull Request
on:
pull_request:
branches: [ master ]
jobs:
jobEmulatorMatrixSetup:
runs-on: ubuntu-latest
outputs:
emulator_jobs_matrix: ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: gradle
- name: Prepare the matrix JSON
run: ./gradlew ciEmulatorJobsMatrixSetup
- id: dataStep
run: echo "emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)" >> $GITHUB_OUTPUT
build-android:
needs: jobEmulatorMatrixSetup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.jobEmulatorMatrixSetup.outputs.emulator_jobs_matrix) }}
steps:
- uses: actions/checkout@v3
- name: Enable KVM group perms
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: Setup test environment
uses: ./.github/actions/setup_test_action
- name: Apply Android licenses
run: ./gradlew ciSdkManagerLicenses
- name: Run Android Instrumented Tests
run: ./gradlew ${{ matrix.gradle_tasks }}
- name: Upload Android test artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Android Test Report HTML"
path: "**/build/reports/androidTests/"
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Firebase Debug Log"
path: "**/firebase-debug.log"
build-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup test environment
uses: ./.github/actions/setup_test_action
timeout-minutes: 10
- name: Run JS Tests
run: ./gradlew cleanTest jsTest
- name: Upload JS test artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: "JS Test Report HTML"
path: |
**/build/reports/tests/jsTest/
**/build/reports/tests/jsBrowserTest/
**/build/reports/tests/jsNodeTest/
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Firebase Debug Log"
path: "**/firebase-debug.log"
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Cocoapods cache
uses: actions/cache@v3
with:
path: |
~/.cocoapods
~/Library/Caches/CocoaPods
*/build/cocoapods
*/build/classes
key: cocoapods-cache-v2
- name: Setup test environment
uses: ./.github/actions/setup_test_action
- name: Run iOS Tests
run: ./gradlew cleanTest iosX64Test
- name: Upload iOS test artifact
uses: actions/upload-artifact@v3
if: failure()
with:
name: "iOS Test Report HTML"
path: "**/build/reports/tests/iosX64Test/"
- name: Upload Firebase Debug Log
uses: actions/upload-artifact@v3
if: failure()
with:
name: "Firebase Debug Log"
path: "**/firebase-debug.log"