Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] use ubuntu runner to launch android emulator #27450

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/cleanup-linux-disk-space/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ runs:
run: |
echo 'Disk space before cleanup'
df -aH
sudo apt-get remove -y --purge '^mysql-.*' '^mongodb-.*' '^postgresql-.*' '^aspnetcore-*' '^dotnet-.*' '^php.*-.*' 'mono-complete'
sudo apt-get remove -y --purge '^mysql-.*' '^mongodb-.*' '^mssql-.*' '^postgresql-.*' '^aspnetcore-*' '^dotnet-.*' '^php.*-.*' 'mono-complete' '^llvm-.*' 'powershell' 'google-chrome-*' 'microsoft-edge-*' 'firefox' 'nginx' 'apache2'
sudo apt-get autoremove -y
sudo rm -rf /usr/share/dotnet
echo 'Showing Android SDKs'
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --list
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --uninstall 'ndk;24.0.8215888' 'ndk;25.2.9519653'
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --uninstall 'ndk;24.0.8215888' 'ndk;25.2.9519653' 'ndk;26.2.11394342'
echo 'Removing all Docker images'
docker rmi -f $(docker images -aq)
echo 'Disk space after cleanup'
Expand Down
25 changes: 7 additions & 18 deletions .github/actions/use-android-emulator/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ outputs:
runs:
using: 'composite'
steps:
- name: ⚙️ Enable KVM for Android virtualization
shell: bash
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

# NOTE: When updating any emulator settings, please make sure all the settings are also updated in each retry step.
# Sorry that we can't use a loop here, because GitHub Actions doesn't support it yet.
- name: '💿 Setup Android Emulator #1'
Expand All @@ -37,13 +44,7 @@ runs:
avd-name: ${{ inputs.avd-name }}
arch: x86_64
target: google_apis
emulator-build: 9536276
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none
emulator-boot-timeout: 900
profile: pixel_6
ram-size: 8192MB
disk-size: 8192MB
heap-size: 2048MB
script: |
# Wait for emulator to fully ready
sleep 20
Expand All @@ -67,13 +68,7 @@ runs:
avd-name: ${{ inputs.avd-name }}
arch: x86_64
target: google_apis
emulator-build: 9536276
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none
emulator-boot-timeout: 900
profile: pixel_6
ram-size: 8192MB
disk-size: 8192MB
heap-size: 2048MB
script: |
# Wait for emulator to fully ready
sleep 20
Expand All @@ -97,13 +92,7 @@ runs:
avd-name: ${{ inputs.avd-name }}
arch: x86_64
target: google_apis
emulator-build: 9536276
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none
emulator-boot-timeout: 900
profile: pixel_6
ram-size: 8192MB
disk-size: 8192MB
heap-size: 2048MB
script: |
# Wait for emulator to fully ready
sleep 20
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/android-instrumentation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ concurrency:

jobs:
test:
runs-on: macos-13
runs-on: ubuntu-22.04
timeout-minutes: 150
env:
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
Expand All @@ -53,6 +53,8 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: 🧹 Cleanup GitHub Linux runner disk space
uses: ./.github/actions/cleanup-linux-disk-space
- name: 🔨 Use JDK 17
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/development-client-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:

jobs:
detox_e2e:
runs-on: macos-13
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [33]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/development-client-latest-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:

jobs:
detox_latest_e2e:
runs-on: macos-13
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [33]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-suite-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:

android-test:
needs: android-build
runs-on: macos-13
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [33]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ jobs:

android-test:
needs: android-build
runs-on: macos-13
runs-on: ubuntu-22.04
strategy:
matrix:
api-level: [33]
Expand Down