From 954c9b74f18d6359cac22ebcbed89c3d9500df9b Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 17:14:19 +0100 Subject: [PATCH 01/13] Fix android emulator test --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e866b86a7..c50a0d2f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,9 @@ jobs: name: Build MacOS uses: ./.github/workflows/build-native.yml with: - runner: macos-latest - binary: macos - build: '["macos"]' + runner: macos-latest + binary: macos + build: '["macos"]' build-linux: name: Build Linux @@ -460,8 +460,6 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none api-level: 31 arch: x86_64 - ndk: 25.2.9519653 - cmake: 3.10.2.4988404 script: cd packages/realm/tests && flutter test integration_test/all_tests.dart --dart-define=BAAS_BAASAAS_API_KEY=$BAAS_BAASAAS_API_KEY --dart-define=BAAS_DIFFERENTIATOR=$BAAS_DIFFERENTIATOR --file-reporter=json:test-results.json --suppress-analytics - name: Publish Test Report @@ -592,7 +590,7 @@ jobs: ** <{{refUrl}}|`{{ref}}` - {{description}}> {{#if description}}<{{diffUrl}}|branch: `{{diffRef}}`>{{/if}} - + web-compile: name: Compile for web runs-on: ubuntu-latest From 2eb89fe88cc8afaea4791905a06c03cc430f6664 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 17:30:56 +0100 Subject: [PATCH 02/13] try 2 --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c50a0d2f2..dc8a24d8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -437,7 +437,7 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: avd-33-x86_64 + key: avd-31-x86_64_2 - name: Create Android Emulator and generate snapshot for caching if: ${{ steps.avd-cache.outputs.cache-hit != 'true' }} @@ -448,8 +448,6 @@ jobs: emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none api-level: 31 arch: x86_64 - ndk: 25.2.9519653 - cmake: 3.10.2.4988404 script: echo "Generated Emulator snapshot for caching." - name: Run tests on Android Emulator From dd9eda5f8b1bde6e139dc46dcba4e12ea02f4d4d Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 17:40:10 +0100 Subject: [PATCH 03/13] Install newer Java --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc8a24d8e..1da22956d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -407,13 +407,13 @@ jobs: sudo udevadm trigger --name-match=kvm - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Setup Java uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 11 + java-version: 21 - name: Fetch artifacts uses: actions/download-artifact@v4 From 305f66d1aa2a1fb645717ef87a86fe06fac42596 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 17:59:11 +0100 Subject: [PATCH 04/13] Use 17 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1da22956d..cae0ca35c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -406,14 +406,14 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Setup Java uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 21 + java-version: 17 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Fetch artifacts uses: actions/download-artifact@v4 From 11c98d6fdddcca3b8777b208f5e0bd8c5f204840 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 18:09:02 +0100 Subject: [PATCH 05/13] Use gradle 8.5.0 and Java 21 --- .github/workflows/ci.yml | 2 +- packages/realm/android/build.gradle | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cae0ca35c..b29cbcc1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -410,7 +410,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: 17 + java-version: 21 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/packages/realm/android/build.gradle b/packages/realm/android/build.gradle index 3ae9aa0fb..81c23a777 100644 --- a/packages/realm/android/build.gradle +++ b/packages/realm/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:8.5.0' } } @@ -36,7 +36,7 @@ android { abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } } - + sourceSets { main { java { @@ -45,7 +45,7 @@ android { jniLibs.srcDirs += ["src/main/cpp/lib/"] } } - + lintOptions { disable 'InvalidPackage' } @@ -134,11 +134,11 @@ def getBundleId() { tasks.register("generateRealmConfig", Copy) { outputs.upToDateWhen { false } - + def bundleId = getBundleId(); from 'src/gen' into "$buildDir/realm-generated" filter { line -> line.replaceAll('realm_bundle_id', "${bundleId}") } } -preBuild.dependsOn runMetrics, downloadRealmBinaries, generateRealmConfig \ No newline at end of file +preBuild.dependsOn runMetrics, downloadRealmBinaries, generateRealmConfig From 1dbc64c964623177d8edb1720c548ead53d91aed Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 18:18:11 +0100 Subject: [PATCH 06/13] Update gradle-wrapper.properties --- .github/workflows/check-pr-title.yml | 22 ------------------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 .github/workflows/check-pr-title.yml diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml deleted file mode 100644 index 1842f5bf3..000000000 --- a/.github/workflows/check-pr-title.yml +++ /dev/null @@ -1,22 +0,0 @@ -# NOTE: This is a common file that is overwritten by realm/ci-actions sync service -# and should only be modified in that repository. - -name: "Check PR Title" -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, converted_to_draft, edited] - -jobs: - check-pr-title: - name: Check PR Title - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: false - - name: Enforce PR title - uses: realm/ci-actions/title-checker@main - with: - regex: R[A-Z]{2,6}-[0-9]{1,6} - error-hint: Invalid PR title. Make sure it's prefixed with the JIRA ticket the PR addresses or add the no-jira-ticket label. - ignore-labels: 'no-jira-ticket' \ No newline at end of file diff --git a/packages/realm/android/gradle/wrapper/gradle-wrapper.properties b/packages/realm/android/gradle/wrapper/gradle-wrapper.properties index 01a286e96..aa49780cd 100644 --- a/packages/realm/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/realm/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip From 962e78b1d90b6f7a07b50fc5b41eb9789034433e Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 18:37:12 +0100 Subject: [PATCH 07/13] Try to overwrite the gradle cache --- .github/workflows/ci.yml | 2 ++ packages/realm/android/build.gradle | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b29cbcc1f..4f15f14df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -414,6 +414,8 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + with: + cache-write-only: true - name: Fetch artifacts uses: actions/download-artifact@v4 diff --git a/packages/realm/android/build.gradle b/packages/realm/android/build.gradle index 81c23a777..e774a16db 100644 --- a/packages/realm/android/build.gradle +++ b/packages/realm/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.5.0' + classpath 'com.android.tools.build:gradle:7.3.0' } } From bd00674fc24364621f4b24ebf131c3a66c8a8d77 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 18:43:36 +0100 Subject: [PATCH 08/13] Try disabling the cache --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f15f14df..2d5300bfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -415,7 +415,7 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 with: - cache-write-only: true + cache-disabled: true - name: Fetch artifacts uses: actions/download-artifact@v4 From 0f23b7132621d4c5ff02e6d8687a7fba8f8881ee Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 18:48:14 +0100 Subject: [PATCH 09/13] Update test gradle packages, revert package properties --- packages/realm/android/gradle/wrapper/gradle-wrapper.properties | 2 +- .../tests/android/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/realm/android/gradle/wrapper/gradle-wrapper.properties b/packages/realm/android/gradle/wrapper/gradle-wrapper.properties index aa49780cd..01a286e96 100644 --- a/packages/realm/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/realm/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties b/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties index 3c472b99c..aa49780cd 100644 --- a/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip From 49a22c34fe3618944c44864b29ecc8b2c75fd43f Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 18:58:21 +0100 Subject: [PATCH 10/13] More fixes --- packages/realm/tests/android/settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/realm/tests/android/settings.gradle b/packages/realm/tests/android/settings.gradle index 7cd712855..19d005581 100644 --- a/packages/realm/tests/android/settings.gradle +++ b/packages/realm/tests/android/settings.gradle @@ -23,7 +23,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false + id "com.android.application" version '8.5.0' apply false } include ":app" From 4c534420b95ba98d5a426cdd0a786ff1b93888b9 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 19:09:00 +0100 Subject: [PATCH 11/13] Upgrade to gradle 8.7 --- packages/realm/android/src/main/AndroidManifest.xml | 3 +-- packages/realm/tests/android/build.gradle | 4 ++++ .../tests/android/gradle/wrapper/gradle-wrapper.properties | 2 +- packages/realm/tests/android/settings.gradle | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/realm/android/src/main/AndroidManifest.xml b/packages/realm/android/src/main/AndroidManifest.xml index 6dbebf509..a2f47b605 100644 --- a/packages/realm/android/src/main/AndroidManifest.xml +++ b/packages/realm/android/src/main/AndroidManifest.xml @@ -1,3 +1,2 @@ - + diff --git a/packages/realm/tests/android/build.gradle b/packages/realm/tests/android/build.gradle index e83fb5dac..162faa9df 100644 --- a/packages/realm/tests/android/build.gradle +++ b/packages/realm/tests/android/build.gradle @@ -18,6 +18,10 @@ allprojects { } rootProject.buildDir = '../build' + +android { + namespace 'io.realm' +} subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } diff --git a/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties b/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties index aa49780cd..348c409ea 100644 --- a/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/realm/tests/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip diff --git a/packages/realm/tests/android/settings.gradle b/packages/realm/tests/android/settings.gradle index 19d005581..0b11d083a 100644 --- a/packages/realm/tests/android/settings.gradle +++ b/packages/realm/tests/android/settings.gradle @@ -23,7 +23,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.5.0' apply false + id "com.android.application" version '8.7.0' apply false } include ":app" From 014fd7ada12cf7fe3d98a3b684a2022cf3d703fc Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 19:21:04 +0100 Subject: [PATCH 12/13] Revert --- packages/realm/android/src/main/AndroidManifest.xml | 3 ++- packages/realm/tests/android/build.gradle | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/realm/android/src/main/AndroidManifest.xml b/packages/realm/android/src/main/AndroidManifest.xml index a2f47b605..6dbebf509 100644 --- a/packages/realm/android/src/main/AndroidManifest.xml +++ b/packages/realm/android/src/main/AndroidManifest.xml @@ -1,2 +1,3 @@ - + diff --git a/packages/realm/tests/android/build.gradle b/packages/realm/tests/android/build.gradle index 162faa9df..e83fb5dac 100644 --- a/packages/realm/tests/android/build.gradle +++ b/packages/realm/tests/android/build.gradle @@ -18,10 +18,6 @@ allprojects { } rootProject.buildDir = '../build' - -android { - namespace 'io.realm' -} subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } From 7a11a18bf8437cfd664a3049b3dd575aada75319 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 2 Jan 2025 19:37:15 +0100 Subject: [PATCH 13/13] Re-enable cache --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d5300bfd..513595ec6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -414,8 +414,6 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - with: - cache-disabled: true - name: Fetch artifacts uses: actions/download-artifact@v4 @@ -451,6 +449,7 @@ jobs: api-level: 31 arch: x86_64 script: echo "Generated Emulator snapshot for caching." + ndk: 27.0.12077973 - name: Run tests on Android Emulator uses: reactivecircus/android-emulator-runner@v2 @@ -461,6 +460,7 @@ jobs: api-level: 31 arch: x86_64 script: cd packages/realm/tests && flutter test integration_test/all_tests.dart --dart-define=BAAS_BAASAAS_API_KEY=$BAAS_BAASAAS_API_KEY --dart-define=BAAS_DIFFERENTIATOR=$BAAS_DIFFERENTIATOR --file-reporter=json:test-results.json --suppress-analytics + ndk: 27.0.12077973 - name: Publish Test Report uses: dorny/test-reporter@v1.8.0