Skip to content

Commit

Permalink
Use ubuntu runner in android tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulak91 committed Jan 17, 2025
1 parent 65f87ae commit 29b5d78
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,24 @@ jobs:
run: yarn cocoapods
- run: yarn test:ios
android:
# https://github.com/ReactiveCircus/android-emulator-runner/issues/46
# TODO: We'd like to bump runner to macos-13 or macos-14, but it no longer works at api-level 29
# (can't find the right emulator). However, bumping api-level doesn't work either! Depending on
# configuration, it either can't find the right emulator or times out as the actual JS tests
# apparently do not complete. I've tried setting arch and target to no avail.
runs-on: macos-12
runs-on: ubuntu-24.04
name: Android tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- 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
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Set Node.js version
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 22.x
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: 'node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -87,14 +87,12 @@ jobs:
- uses: gradle/actions/setup-gradle@v3
# See: https://github.com/android/compose-samples/actions/runs/27015993/workflow for ideas for caching
- name: run tests
uses: reactivecircus/android-emulator-runner@v2.31.0
uses: reactivecircus/android-emulator-runner@v2.33.0
with:
api-level: 29
# target: google_apis
# arch: x86_64
working-directory: ./native/androidTest
script: ./gradlew connectedAndroidTest
# - run: yarn ktlint
- run: yarn ktlint
windows:
# FIXME: Windows port is unmaintained. If you're interested in sponsoring continued maintenance,
# please email me!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

import com.nozbe.watermelondb.jsi.WatermelonJSI

class MainActivity : ReactActivity() {
Expand All @@ -16,5 +15,5 @@ class MainActivity : ReactActivity() {
}

override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ package com.nozbe.watermelonTest
import android.app.Application
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.JSIModule
import com.facebook.react.bridge.JSIModulePackage
import com.facebook.react.bridge.JSIModuleSpec
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.shell.MainReactPackage
Expand Down
7 changes: 4 additions & 3 deletions native/androidTest/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#android.useDeprecatedNdk=true
org.gradle.parallel=true

MYAPP_RELEASE_STORE_FILE=DemoKeystore.keystore
MYAPP_RELEASE_KEY_ALIAS=DemoKeystoreAlias
MYAPP_RELEASE_STORE_PASSWORD=DemoKeystore
MYAPP_RELEASE_KEY_PASSWORD=DemoKeystore
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m

android.useAndroidX=true
android.enableJetifier=true
#android.useDeprecatedNdk=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
Expand Down

0 comments on commit 29b5d78

Please sign in to comment.