From 27c4c39deac310747a5c7931c36b42ab2846b6a6 Mon Sep 17 00:00:00 2001 From: Clemente Date: Tue, 4 Jun 2024 16:40:40 +0200 Subject: [PATCH 01/74] Add kotlin compiler matcher --- .github/problem-matchers/kotlin.json | 32 ++++++++++++++++++++++++++++ .github/workflows/pr.yml | 4 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/problem-matchers/kotlin.json diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json new file mode 100644 index 0000000000..15a4ae0bc9 --- /dev/null +++ b/.github/problem-matchers/kotlin.json @@ -0,0 +1,32 @@ +{ + "problemMatcher": [ + { + "owner": "kotlin", + "severity": "error", + "pattern": [ + { + "regexp": "e:\\s(.+):(\\d+):(\\d+)\\s(.+)", + "file": 2, + "line": 3, + "column": 4, + "severity": 1, + "message": 5 + } + ] + }, + { + "owner": "kotlin", + "severity": "warning", + "pattern": [ + { + "regexp": "w:\\s(.+):(\\d+):(\\d+)\\s(.+)", + "file": 2, + "line": 3, + "column": 4, + "severity": 1, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4a67c1f0a4..2db75616d4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -40,7 +40,9 @@ jobs: uses: actions/checkout@v3 with: submodules: "recursive" - + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" - name: Setup Java 11 uses: actions/setup-java@v3 with: From ff367e375362c01898b2188220c2735966da205f Mon Sep 17 00:00:00 2001 From: Clemente Date: Tue, 4 Jun 2024 16:48:16 +0200 Subject: [PATCH 02/74] Update workflow --- .github/workflows/pr.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2db75616d4..32de46838b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -40,9 +40,6 @@ jobs: uses: actions/checkout@v3 with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - name: Setup Java 11 uses: actions/setup-java@v3 with: @@ -515,6 +512,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v3 with: From 03a14ee167d515e6d38f830d80855e45ab9e0a36 Mon Sep 17 00:00:00 2001 From: Clemente Date: Tue, 4 Jun 2024 16:56:22 +0200 Subject: [PATCH 03/74] Update matchers --- .github/problem-matchers/kotlin.json | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 15a4ae0bc9..ea4792f6ca 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -6,11 +6,10 @@ "pattern": [ { "regexp": "e:\\s(.+):(\\d+):(\\d+)\\s(.+)", - "file": 2, - "line": 3, - "column": 4, - "severity": 1, - "message": 5 + "file": 1, + "line": 2, + "column": 3, + "message": 4 } ] }, @@ -20,11 +19,10 @@ "pattern": [ { "regexp": "w:\\s(.+):(\\d+):(\\d+)\\s(.+)", - "file": 2, - "line": 3, - "column": 4, - "severity": 1, - "message": 5 + "file": 1, + "line": 2, + "column": 3, + "message": 4 } ] } From 2acb2bd1caa9bcd9c84210af3ac2f07d86731a64 Mon Sep 17 00:00:00 2001 From: Clemente Date: Tue, 4 Jun 2024 17:11:37 +0200 Subject: [PATCH 04/74] deduplicate owners --- .github/problem-matchers/kotlin.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index ea4792f6ca..38754d77ad 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -1,7 +1,7 @@ { "problemMatcher": [ { - "owner": "kotlin", + "owner": "kotlin-error", "severity": "error", "pattern": [ { @@ -14,7 +14,7 @@ ] }, { - "owner": "kotlin", + "owner": "kotlin-warning", "severity": "warning", "pattern": [ { From 445f7ea9ba95fce25f42c3d0277c783f3263c2a2 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 10:55:38 +0200 Subject: [PATCH 05/74] Bump actions versions --- .github/workflows/include-static-analysis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 4f456ecae0..165fb7ab08 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -9,17 +9,17 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false # TODO How to configure caching here? - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} From 1a14a3eb757b9e842e067981214c7c5116d5ae23 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 11:03:28 +0200 Subject: [PATCH 06/74] Bump checkout --- .github/workflows/auto-merge-branches.yml | 2 +- .github/workflows/include-deploy-release.yml | 2 +- .github/workflows/include-deploy-snapshot.yml | 2 +- .../workflows/include-integration-tests.yml | 18 ++++---- .github/workflows/include-static-analysis.yml | 2 +- .github/workflows/pr.yml | 41 +++++++++---------- 6 files changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/auto-merge-branches.yml b/.github/workflows/auto-merge-branches.yml index cd16801f2e..9df6218f79 100644 --- a/.github/workflows/auto-merge-branches.yml +++ b/.github/workflows/auto-merge-branches.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Set the branch we want to merge changes into as step output. This step should list each branch name found in the `push` # trigger in the top of this file. diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 4dc1d2d163..d0b0877e60 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -18,7 +18,7 @@ jobs: steps: - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" diff --git a/.github/workflows/include-deploy-snapshot.yml b/.github/workflows/include-deploy-snapshot.yml index d50f9abbdc..199dd0fa4e 100644 --- a/.github/workflows/include-deploy-snapshot.yml +++ b/.github/workflows/include-deploy-snapshot.yml @@ -19,7 +19,7 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: git checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" diff --git a/.github/workflows/include-integration-tests.yml b/.github/workflows/include-integration-tests.yml index 6f23b27bbb..24713bc4b9 100644 --- a/.github/workflows/include-integration-tests.yml +++ b/.github/workflows/include-integration-tests.yml @@ -19,7 +19,7 @@ jobs: # runs-on: macos-12 # steps: # - name: Checkout code - # uses: actions/checkout@v3 + # uses: actions/checkout@v4 # - name: Setup Java 11 # uses: actions/setup-java@v3 @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java 11 uses: actions/setup-java@v3 @@ -90,7 +90,7 @@ jobs: runs-on: macos-12 steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java 11 uses: actions/setup-java@v3 @@ -171,10 +171,10 @@ jobs: build-benchmarks: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java 11 uses: actions/setup-java@v3 @@ -213,10 +213,10 @@ jobs: arguments: integrationTest runs-on: macos-12 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java 11 uses: actions/setup-java@v3 @@ -294,10 +294,10 @@ jobs: arguments: integrationTest runs-on: macos-12 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Java 17 uses: actions/setup-java@v3 diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 165fb7ab08..d5d71dcc7a 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -58,7 +58,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 32de46838b..5bcd150d6d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -28,7 +28,6 @@ jobs: check-cache: uses: ./.github/workflows/include-check-cache.yml - # We build the same JNI SWIG stub once and re-use it across platforms to ensure any problems # with SWIG if we compile on each seperate platform. build-jni-swig-stub: @@ -37,7 +36,7 @@ jobs: if: always() && !cancelled() && needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" - name: Setup Java 11 @@ -47,7 +46,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -103,7 +102,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -170,7 +169,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # TODO See https://github.com/microsoft/vcpkg/issues/25349 which might describe the error here https://github.com/realm/realm-kotlin/runs/8099890473?check_suite_focus=true # -- Building for: Visual Studio 17 2022 @@ -239,7 +238,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -325,7 +324,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -405,7 +404,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -508,7 +507,7 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -647,7 +646,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -716,7 +715,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -784,7 +783,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -853,7 +852,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -944,7 +943,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -1073,7 +1072,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Restore Android Test APK uses: actions/download-artifact@v3 @@ -1110,7 +1109,7 @@ jobs: !contains(needs.*.result, 'cancelled') steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # checkout BAAS CLI repo - name: Checkout BAAS repo @@ -1207,7 +1206,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # checkout BAAS CLI repo - name: Checkout BAAS repo @@ -1329,7 +1328,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # checkout BAAS CLI repo - name: Checkout BAAS repo @@ -1463,7 +1462,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # checkout BAAS CLI repo - name: Checkout BAAS repo @@ -1562,7 +1561,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # The Metadata artifact contain broken JVM publications, so it needs to be # restored first, it so they can be overidden with the correct ones. @@ -1660,7 +1659,7 @@ jobs: is_publish_build: ${{ steps.check_release.outputs.is_publish_build }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check if release build id: check_release From e106e6cd2334922efc621ba1a01ccd669121bc0f Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 11:18:15 +0200 Subject: [PATCH 07/74] bum upload-artifact --- .github/workflows/include-check-cache.yml | 28 +++++----- .github/workflows/include-deploy-release.yml | 2 +- .../workflows/include-integration-tests.yml | 6 +- .github/workflows/pr.yml | 56 +++++++++---------- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 5ce3783432..03e16df0ef 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -80,7 +80,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: "recursive" @@ -130,7 +130,7 @@ jobs: key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} - name: Save Kotlin Metadata packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' with: name: packages-metadata-${{ steps.find-library-version.outputs.label }} @@ -155,7 +155,7 @@ jobs: key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} - name: Save JVM packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' with: name: packages-jvm-${{ steps.find-library-version.outputs.label }} @@ -180,7 +180,7 @@ jobs: key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} - name: Save JNI Stub packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' with: name: jni-stub-${{ steps.find-library-version.outputs.label }} @@ -205,7 +205,7 @@ jobs: key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} - name: Save JNI MacOS lib package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' with: name: jni-macos-lib-${{ steps.find-library-version.outputs.label }} @@ -230,7 +230,7 @@ jobs: key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} - name: Save JNI Linux lib package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' with: name: jni-linux-lib-${{ steps.find-library-version.outputs.label }} @@ -255,7 +255,7 @@ jobs: key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} - name: Save Android packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' with: name: packages-android-${{ steps.find-library-version.outputs.label }} @@ -280,7 +280,7 @@ jobs: key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} - name: Save Android Base Test APK - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' with: name: android-base-test-apk-${{ steps.find-library-version.outputs.label }} @@ -307,7 +307,7 @@ jobs: ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - name: Save Android Sync Test APK - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' with: name: android-sync-test-apk-${{ steps.find-library-version.outputs.label }} @@ -336,7 +336,7 @@ jobs: key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - name: Save MacOS arm64 packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' with: name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} @@ -361,7 +361,7 @@ jobs: key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - name: Save MacOS x64 packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' with: name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} @@ -386,7 +386,7 @@ jobs: key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - name: Save iOS arm64 packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' with: name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} @@ -411,7 +411,7 @@ jobs: key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - name: Save iOS x64 packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' with: name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} @@ -437,7 +437,7 @@ jobs: enableCrossOsArchive: true - name: Save JNI Windows lib package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' with: name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index d0b0877e60..9b4484d5db 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -71,7 +71,7 @@ jobs: # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Setup build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-jvm-sync-${{ inputs.packages-sha-label }} diff --git a/.github/workflows/include-integration-tests.yml b/.github/workflows/include-integration-tests.yml index 24713bc4b9..0b3121781a 100644 --- a/.github/workflows/include-integration-tests.yml +++ b/.github/workflows/include-integration-tests.yml @@ -110,7 +110,7 @@ jobs: path: ./packages/build/m2-buildrepo # - name: AVD cache - # uses: actions/cache@v3 + # uses: actions/cache@v4 # id: avd-cache # with: # path: | @@ -236,7 +236,7 @@ jobs: path: ./packages/build/m2-buildrepo # - name: AVD cache - # uses: actions/cache@v3 + # uses: actions/cache@v4 # id: avd-cache # with: # path: | @@ -317,7 +317,7 @@ jobs: path: ./packages/build/m2-buildrepo # - name: AVD cache - # uses: actions/cache@v3 + # uses: actions/cache@v4 # id: avd-cache # with: # path: | diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5bcd150d6d..7322527c0a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -51,7 +51,7 @@ jobs: cache-read-only: false - name: Load build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/jni-swig-stub/build/generated/sources/jni key: jni-swig-stubs-${{ needs.check-cache.outputs.packages-sha }} @@ -84,7 +84,7 @@ jobs: run: ./gradlew :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ./packages/jni-swig-stub/build/generated/sources/jni/* @@ -107,7 +107,7 @@ jobs: submodules: "recursive" - name: Setup build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmLinuxBuild key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} @@ -151,7 +151,7 @@ jobs: make -j8 - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmLinuxBuild/librealmc.so @@ -183,7 +183,7 @@ jobs: submodules: "recursive" - name: Setup build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmWindowsBuild key: jni-windows-lib-${{ needs.check-cache.outputs.packages-sha }} @@ -220,7 +220,7 @@ jobs: cmake --build . --config Release - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll @@ -290,7 +290,7 @@ jobs: # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Setup build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmMacOsBuild key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} @@ -306,7 +306,7 @@ jobs: run: ./gradlew buildJVMSharedLibs -Prealm.kotlin.mainHost=false - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmMacOsBuild/librealmc.dylib @@ -373,7 +373,7 @@ jobs: ndk-version: r23c - name: Setup build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-metadata-${{ needs.check-cache.outputs.packages-sha }} @@ -383,7 +383,7 @@ jobs: run: ./gradlew publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* @@ -454,7 +454,7 @@ jobs: # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Setup build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} @@ -482,7 +482,7 @@ jobs: run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* @@ -592,20 +592,20 @@ jobs: run: ./gradlew publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - name: Store build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-android-sync-${{ needs.check-cache.outputs.packages-sha }} - name: Store build cache for Android Test APK - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk key: android-base-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} # Must match naming found in include-check-cache.yml - name: Store build cache for Android Sync Test APK - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: android-sync-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} path: | @@ -615,21 +615,21 @@ jobs: # Must match naming found in include-check-cache.yml # Must match naming found in include-check-cache.yml - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-android-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - name: Upload Android Base Test APK - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk retention-days: 1 - name: Upload Android Sync Test APK - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} retention-days: 1 @@ -694,14 +694,14 @@ jobs: # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Store build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-macos-x64-sync-${{ needs.check-cache.outputs.packages-sha }} # Must match naming found in include-check-cache.yml - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* @@ -762,14 +762,14 @@ jobs: run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false - name: Store build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-macos-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} # Must match naming found in include-check-cache.yml - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* @@ -831,14 +831,14 @@ jobs: # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Store build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-ios-x64-sync-${{ needs.check-cache.outputs.packages-sha }} # Must match naming found in include-check-cache.yml - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* @@ -900,14 +900,14 @@ jobs: # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Store build cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-ios-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} # Must match naming found in include-check-cache.yml - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* @@ -1029,7 +1029,7 @@ jobs: cd packages && ./gradlew :test-${{ matrix.type }}:connectedCheck -PsyncUsePlatformNetworking=true -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} -PincludeSdkModules=false --info --no-daemon - name: Archive LogCat data - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() || failure() with: name: logcat-${{ matrix.type }}-emulator.txt @@ -1608,7 +1608,7 @@ jobs: path: ./packages/build/m2-buildrepo - name: Upload artifacts bundle - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: all-packages-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo From 15249342cfab4025780777da83946fb2614ee055 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 11:25:25 +0200 Subject: [PATCH 08/74] bump gradle/gradle-build-action@v2 --- .github/workflows/include-deploy-release.yml | 2 +- .../workflows/include-integration-tests.yml | 12 +++++----- .github/workflows/include-static-analysis.yml | 2 +- .github/workflows/pr.yml | 24 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 9b4484d5db..50935d1b98 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -29,7 +29,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false diff --git a/.github/workflows/include-integration-tests.yml b/.github/workflows/include-integration-tests.yml index 0b3121781a..5f73d5caa3 100644 --- a/.github/workflows/include-integration-tests.yml +++ b/.github/workflows/include-integration-tests.yml @@ -28,7 +28,7 @@ jobs: # java-version: 11 # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle-build-action@v2 + # uses: gradle/gradle/actions/setup-gradle@v3 # with: # cache-read-only: false @@ -69,7 +69,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -99,7 +99,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -183,7 +183,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -225,7 +225,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -306,7 +306,7 @@ jobs: java-version: 17 - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index d5d71dcc7a..53a36954db 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -63,7 +63,7 @@ jobs: submodules: "recursive" - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false # TODO How to configure caching here? diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7322527c0a..3d970c2e14 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -249,7 +249,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -335,7 +335,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -415,7 +415,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -522,7 +522,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -657,7 +657,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -726,7 +726,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -794,7 +794,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -863,7 +863,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -975,7 +975,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1236,7 +1236,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1358,7 +1358,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1492,7 +1492,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/gradle/actions/setup-gradle@v3 with: cache-read-only: false From 8149117e1dddaf861568378f4ffd914f4038cf13 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 11:27:06 +0200 Subject: [PATCH 09/74] Update download artifact --- .github/workflows/include-deploy-release.yml | 8 ++-- .github/workflows/include-deploy-snapshot.yml | 2 +- .../workflows/include-integration-tests.yml | 12 ++--- .github/workflows/pr.yml | 48 +++++++++---------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 50935d1b98..df4d056361 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -77,25 +77,25 @@ jobs: key: packages-m2-jvm-sync-${{ inputs.packages-sha-label }} - name: Restore Linux JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-linux-lib-${{ inputs.version-label }} path: ./packages/cinterop/build/realmLinuxBuild - name: Restore Windows JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-windows-lib-${{ inputs.version-label }} path: ./packages/cinterop/build/realmWindowsBuild/Release - name: Restore MacOS JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-macos-lib-${{ inputs.version-label }} path: ./packages/cinterop/build/realmMacOsBuild - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo diff --git a/.github/workflows/include-deploy-snapshot.yml b/.github/workflows/include-deploy-snapshot.yml index 199dd0fa4e..61416d071d 100644 --- a/.github/workflows/include-deploy-snapshot.yml +++ b/.github/workflows/include-deploy-snapshot.yml @@ -35,7 +35,7 @@ jobs: version: ${{ vars.VERSION_KOTLIN_COMMANDLINE_TOOLS }} - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo diff --git a/.github/workflows/include-integration-tests.yml b/.github/workflows/include-integration-tests.yml index 5f73d5caa3..33e48d70b7 100644 --- a/.github/workflows/include-integration-tests.yml +++ b/.github/workflows/include-integration-tests.yml @@ -33,7 +33,7 @@ jobs: # cache-read-only: false # - name: Restore m2-buildrepo - # uses: actions/download-artifact@v3 + # uses: actions/download-artifact@v4 # with: # name: all-packages-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo @@ -74,7 +74,7 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo @@ -104,7 +104,7 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo @@ -188,7 +188,7 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo @@ -230,7 +230,7 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo @@ -311,7 +311,7 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: all-packages-${{ inputs.version-label }} path: ./packages/build/m2-buildrepo diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3d970c2e14..b915150487 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -118,7 +118,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ./packages/jni-swig-stub/build/generated/sources/jni @@ -195,7 +195,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni @@ -296,7 +296,7 @@ jobs: key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni @@ -460,19 +460,19 @@ jobs: key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} - name: Restore Linux JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmLinuxBuild - name: Restore Windows JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmWindowsBuild/Release - name: Restore MacOS JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmMacOsBuild @@ -980,19 +980,19 @@ jobs: cache-read-only: false - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore m2-buildrepo (Android) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-android-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore m2-buildrepo (JVM) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1075,7 +1075,7 @@ jobs: uses: actions/checkout@v4 - name: Restore Android Test APK - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} path: ./packages/test-base/build/outputs/apk/androidTest/debug @@ -1129,7 +1129,7 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Restore Android Sync Test APK - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} path: ./packages/test-sync/build/outputs/apk/ @@ -1241,13 +1241,13 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1363,13 +1363,13 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo (ios) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1497,13 +1497,13 @@ jobs: cache-read-only: false - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1566,43 +1566,43 @@ jobs: # The Metadata artifact contain broken JVM publications, so it needs to be # restored first, it so they can be overidden with the correct ones. - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore Android artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-android-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore JVM artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore MacOS x64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore MacOS arm64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore iOS x64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore iOS arm64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo From 2217f69edc363d8cf2a3ff8b057279bbb4770e92 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 11:30:31 +0200 Subject: [PATCH 10/74] Fix uses --- .github/workflows/include-deploy-release.yml | 2 +- .../workflows/include-integration-tests.yml | 12 +++++----- .github/workflows/include-static-analysis.yml | 2 +- .github/workflows/pr.yml | 24 +++++++++---------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index df4d056361..89c1635ca3 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -29,7 +29,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false diff --git a/.github/workflows/include-integration-tests.yml b/.github/workflows/include-integration-tests.yml index 33e48d70b7..5a1dd840ef 100644 --- a/.github/workflows/include-integration-tests.yml +++ b/.github/workflows/include-integration-tests.yml @@ -28,7 +28,7 @@ jobs: # java-version: 11 # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 + # uses: gradle/actions/setup-gradle@v3 # with: # cache-read-only: false @@ -69,7 +69,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -99,7 +99,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -183,7 +183,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -225,7 +225,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -306,7 +306,7 @@ jobs: java-version: 17 - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 53a36954db..f085ff0a63 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -63,7 +63,7 @@ jobs: submodules: "recursive" - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false # TODO How to configure caching here? diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b915150487..e468e6104a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -249,7 +249,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -335,7 +335,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -415,7 +415,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -522,7 +522,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -657,7 +657,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -726,7 +726,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -794,7 +794,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -863,7 +863,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -975,7 +975,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1236,7 +1236,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1358,7 +1358,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1492,7 +1492,7 @@ jobs: java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false From f1c81533931dbb2150321131a88c7417bd9c97a6 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 11:37:59 +0200 Subject: [PATCH 11/74] bump actions cmake --- .github/workflows/include-deploy-release.yml | 2 +- .github/workflows/include-static-analysis.yml | 2 +- .github/workflows/pr.yml | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 89c1635ca3..34920a3c9a 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -34,7 +34,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index f085ff0a63..a4873d7bab 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -68,7 +68,7 @@ jobs: cache-read-only: false # TODO How to configure caching here? - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e468e6104a..d0bc24b2a9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -57,7 +57,7 @@ jobs: key: jni-swig-stubs-${{ needs.check-cache.outputs.packages-sha }} - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -113,7 +113,7 @@ jobs: key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -190,7 +190,7 @@ jobs: enableCrossOsArchive: true - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -254,7 +254,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -340,7 +340,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -420,7 +420,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -547,7 +547,7 @@ jobs: run: brew install jq - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -662,7 +662,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -731,7 +731,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -799,7 +799,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -868,7 +868,7 @@ jobs: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: ${{ vars.VERSION_CMAKE }} From a1190392ca752025913030c3079170bdabc7bb7c Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 15:12:40 +0200 Subject: [PATCH 12/74] Bum setup java --- .github/workflows/include-deploy-release.yml | 2 +- .github/workflows/include-deploy-snapshot.yml | 2 +- .../workflows/include-integration-tests.yml | 12 ++++----- .github/workflows/pr.yml | 26 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 34920a3c9a..7af6718f8b 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -23,7 +23,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} diff --git a/.github/workflows/include-deploy-snapshot.yml b/.github/workflows/include-deploy-snapshot.yml index 61416d071d..83dbf0fbd3 100644 --- a/.github/workflows/include-deploy-snapshot.yml +++ b/.github/workflows/include-deploy-snapshot.yml @@ -24,7 +24,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} diff --git a/.github/workflows/include-integration-tests.yml b/.github/workflows/include-integration-tests.yml index 5a1dd840ef..2d3349ec8e 100644 --- a/.github/workflows/include-integration-tests.yml +++ b/.github/workflows/include-integration-tests.yml @@ -22,7 +22,7 @@ jobs: # uses: actions/checkout@v4 # - name: Setup Java 11 - # uses: actions/setup-java@v3 + # uses: actions/setup-java@v4 # with: # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} # java-version: 11 @@ -63,7 +63,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -93,7 +93,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -177,7 +177,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -219,7 +219,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -300,7 +300,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Java 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: 17 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d0bc24b2a9..ac31dc69ea 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -40,7 +40,7 @@ jobs: with: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -243,7 +243,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -329,7 +329,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -409,7 +409,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -516,7 +516,7 @@ jobs: echo "::add-matcher::.github/problem-matchers/kotlin.json" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -651,7 +651,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -720,7 +720,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -788,7 +788,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -857,7 +857,7 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -969,7 +969,7 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -1230,7 +1230,7 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -1352,7 +1352,7 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -1486,7 +1486,7 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} From 002f749912cffaf4c73c3186153572e7d185a01c Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 15:30:33 +0200 Subject: [PATCH 13/74] Update cache action --- .github/workflows/include-check-cache.yml | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 03e16df0ef..daa2238aa6 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -124,7 +124,7 @@ jobs: # - name: Check Kotlin Metadata cache id: kotlin-metadata-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} @@ -149,7 +149,7 @@ jobs: # - name: Check JVM cache id: jvm-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} @@ -174,7 +174,7 @@ jobs: # - name: Check JNI Swig stub cache id: jni-swig-stub-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/jni-swig-stub/build/generated/sources/jni key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} @@ -199,7 +199,7 @@ jobs: # - name: Check JNI MacOS lib cache id: jni-macos-lib-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/cinterop/build/realmMacOsBuild key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} @@ -224,7 +224,7 @@ jobs: # - name: Check JNI Linux lib cache id: jni-linux-lib-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/cinterop/build/realmLinuxBuild key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} @@ -249,7 +249,7 @@ jobs: # - name: Check Android cache id: android-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} @@ -274,7 +274,7 @@ jobs: # - name: Check Android Base Test APK id: android-test-base-apk - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} @@ -299,7 +299,7 @@ jobs: # - name: Check Android Sync Test APK id: android-test-sync-apk - uses: cmelchior/cache@main + uses: clementetb/cache@main with: key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} path: | @@ -330,7 +330,7 @@ jobs: # - name: Check MacOS arm64 cache id: macos-arm64-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} @@ -355,7 +355,7 @@ jobs: # - name: Check MacOS X64 cache id: macos-x64-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} @@ -380,7 +380,7 @@ jobs: # - name: Check iOS arm64 cache id: ios-arm64-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} @@ -405,7 +405,7 @@ jobs: # - name: Check iOS X64 cache id: ios-x64-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/build/m2-buildrepo key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} @@ -430,7 +430,7 @@ jobs: # - name: Check JNI Windows lib cache id: jni-windows-lib-cache - uses: cmelchior/cache@main + uses: clementetb/cache@main with: path: ./packages/cinterop/build/realmWindowsBuild key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} From f128b5feccc9da0cdf5dcd731f2154d6a3246e3e Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 15:34:27 +0200 Subject: [PATCH 14/74] Bump checkstyle --- .github/workflows/include-static-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index a4873d7bab..64f11b5fb8 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -46,7 +46,7 @@ jobs: rsync -a --delete --ignore-errors benchmarks/build/reports/ktlint/ /tmp/ktlint/benchmarks/ || true - name: Publish Ktlint results - uses: cmelchior/checkstyle-github-action@master + uses: clementetb/checkstyle-github-action@master if: always() with: name: Ktlint Results @@ -93,7 +93,7 @@ jobs: rsync -a --delete --ignore-errors benchmarks/build/reports/detekt/ /tmp/detekt/benchmarks/ || true - name: Publish Detekt results - uses: cmelchior/checkstyle-github-action@master + uses: clementetb/checkstyle-github-action@master if: always() with: name: Detekt Results From 5f4d4d3fcf2d119ef5c1bad1a81bd9478ebbb5ee Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 15:55:20 +0200 Subject: [PATCH 15/74] Use lookup-only --- .github/workflows/include-check-cache.yml | 57 +++++++++++------------ 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index daa2238aa6..67062d433a 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -57,8 +57,6 @@ jobs: check-cache: runs-on: ubuntu-latest name: Check cache - env: - CACHE_SKIP_SAVE: true outputs: version-label: ${{ steps.find-library-version.outputs.label }} packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} @@ -109,25 +107,17 @@ jobs: # # 1. Check if a cache is available and download it if it is. # 2. If (1), store this cache as an artifact for jobs downstream to use. - # 3. Cleanup the build folder. This is required so we can download the next - # platform into a fresh cache location. It does not look possible to download - # a cache into a different location. - # - # TODO There doesn't seem to be a good way to check if a cache key exists without download it. - # https://github.com/actions/cache/issues/321 - # - # TODO Create a custom action for this until we have a work-around? - # # # Kotlin Metadata and Gradle/Compiler Plugin # - name: Check Kotlin Metadata cache id: kotlin-metadata-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save Kotlin Metadata packages uses: actions/upload-artifact@v4 @@ -137,22 +127,16 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded JVM cache files - id: delete-cache-metadata - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # JVM (All platforms) # - name: Check JVM cache id: jvm-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save JVM packages uses: actions/upload-artifact@v4 @@ -174,10 +158,11 @@ jobs: # - name: Check JNI Swig stub cache id: jni-swig-stub-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/jni-swig-stub/build/generated/sources/jni key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save JNI Stub packages uses: actions/upload-artifact@v4 @@ -199,10 +184,11 @@ jobs: # - name: Check JNI MacOS lib cache id: jni-macos-lib-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmMacOsBuild key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save JNI MacOS lib package uses: actions/upload-artifact@v4 @@ -224,10 +210,11 @@ jobs: # - name: Check JNI Linux lib cache id: jni-linux-lib-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmLinuxBuild key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save JNI Linux lib package uses: actions/upload-artifact@v4 @@ -249,10 +236,11 @@ jobs: # - name: Check Android cache id: android-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save Android packages uses: actions/upload-artifact@v4 @@ -274,10 +262,11 @@ jobs: # - name: Check Android Base Test APK id: android-test-base-apk - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save Android Base Test APK uses: actions/upload-artifact@v4 @@ -299,12 +288,13 @@ jobs: # - name: Check Android Sync Test APK id: android-test-sync-apk - uses: clementetb/cache@main + uses: actions/cache@v4 with: key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} path: | ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + lookup-only: true - name: Save Android Sync Test APK uses: actions/upload-artifact@v4 @@ -330,10 +320,11 @@ jobs: # - name: Check MacOS arm64 cache id: macos-arm64-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save MacOS arm64 packages uses: actions/upload-artifact@v4 @@ -355,10 +346,11 @@ jobs: # - name: Check MacOS X64 cache id: macos-x64-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save MacOS x64 packages uses: actions/upload-artifact@v4 @@ -380,10 +372,11 @@ jobs: # - name: Check iOS arm64 cache id: ios-arm64-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save iOS arm64 packages uses: actions/upload-artifact@v4 @@ -405,10 +398,11 @@ jobs: # - name: Check iOS X64 cache id: ios-x64-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + lookup-only: true - name: Save iOS x64 packages uses: actions/upload-artifact@v4 @@ -430,11 +424,12 @@ jobs: # - name: Check JNI Windows lib cache id: jni-windows-lib-cache - uses: clementetb/cache@main + uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmWindowsBuild key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} enableCrossOsArchive: true + lookup-only: true - name: Save JNI Windows lib package uses: actions/upload-artifact@v4 From 03c8ec97b519d3b43ede4f4da460594769b23851 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 16:02:15 +0200 Subject: [PATCH 16/74] Remove JesseTG/rm --- .github/workflows/include-check-cache.yml | 86 ----------------------- 1 file changed, 86 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 67062d433a..cd3ac52174 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -146,13 +146,6 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded JVM cache files - id: delete-cache-jvm - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # JNI Stub (JVM) # @@ -172,13 +165,6 @@ jobs: path: ./packages/jni-swig-stub/build/generated/sources/jni/* retention-days: 1 - - name: Delete downloaded JVM cache files - id: delete-cache-jni-stub - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' - with: - path: ./packages/jni-swig-stub/build/generated/sources/jni - # # JNI MacOS Lib # @@ -198,13 +184,6 @@ jobs: path: ./packages/cinterop/build/realmMacOsBuild/**/* retention-days: 1 - - name: Delete downloaded JVM cache files - id: delete-cache-macos-lib - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' - with: - path: ./packages/cinterop/build/realmMacOsBuild - # # JNI Linux Lib # @@ -224,13 +203,6 @@ jobs: path: ./packages/cinterop/build/realmLinuxBuild/**/* retention-days: 1 - - name: Delete downloaded JVM cache files - id: delete-cache-linux-lib - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' - with: - path: ./packages/cinterop/build/realmLinuxBuild - # # Android # @@ -250,13 +222,6 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded Android cache files - id: delete-cache-android - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # Android Base Test APK # @@ -276,13 +241,6 @@ jobs: path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk retention-days: 1 - - name: Delete Android Base Test APK cache files - id: delete-cache-android-base-test-apk - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' - with: - path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - # # Android Sync Test APK # @@ -306,15 +264,6 @@ jobs: ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - name: Delete Android Sync Test APK cache files - id: delete-cache-android-sync-test-apk - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' - with: - path: | - ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - # # MacOS arm64 # @@ -334,13 +283,6 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded MacOS arm64 cache files - id: delete-cache-macos-arm64 - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # MacOS x64 # @@ -360,13 +302,6 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded MacOS x64 cache files - id: delete-cache-macos-x64 - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # iOS arm64 # @@ -386,13 +321,6 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded iOS arm64 cache files - id: delete-cache-ios-arm64 - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # iOS x64 # @@ -412,13 +340,6 @@ jobs: path: ./packages/build/m2-buildrepo/**/* retention-days: 1 - - name: Delete downloaded iOS x64 cache files - id: delete-cache-ios-x64 - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' - with: - path: ./packages/build/m2-buildrepo - # # JNI Windows Lib # @@ -438,10 +359,3 @@ jobs: name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll retention-days: 1 - - - name: Delete downloaded JNI Windows lib cache files - id: delete-cache-windows-lib - uses: JesseTG/rm@v1.0.3 - if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' - with: - path: ./packages/cinterop/build/realmWindowsBuild From 361f5885dc6836be0d2fda4bb98c9c3065fb228c Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 22:16:18 +0200 Subject: [PATCH 17/74] Disable Actions --- .github/workflows/pr.yml | 3190 +++++++++++++++++++------------------- 1 file changed, 1595 insertions(+), 1595 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ac31dc69ea..ffbccacdf5 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,8 +26,8 @@ jobs: static-analysis: uses: ./.github/workflows/include-static-analysis.yml - check-cache: - uses: ./.github/workflows/include-check-cache.yml + # check-cache: + # uses: ./.github/workflows/include-check-cache.yml # We build the same JNI SWIG stub once and re-use it across platforms to ensure any problems # with SWIG if we compile on each seperate platform. build-jni-swig-stub: @@ -40,7 +40,7 @@ jobs: with: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v4 + uses: actions/setup-java@v3 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -57,7 +57,7 @@ jobs: key: jni-swig-stubs-${{ needs.check-cache.outputs.packages-sha }} - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 + uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -90,1604 +90,1604 @@ jobs: path: ./packages/jni-swig-stub/build/generated/sources/jni/* retention-days: 1 - build-jvm-linux-native-lib: - runs-on: ubuntu-latest - needs: [check-cache, build-jni-swig-stub] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - needs.check-cache.outputs.jni-linux-lib-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup build cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmLinuxBuild - key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v4 - with: - name: jni-stub-${{ needs.check-cache.outputs.version-label }} - path: ./packages/jni-swig-stub/build/generated/sources/jni - - - name: Build Docker image - uses: docker/build-push-action@v3 - with: - tags: jvm-native-lib-linux:latest - file: ./packages/cinterop/src/jvmMain/generic.Dockerfile - push: false - - - name: Build native lib - uses: addnab/docker-run-action@v3 - with: - image: jvm-native-lib-linux:latest - shell: bash - options: -v ${{ github.workspace }}:/work - run: | - cd /work/packages/cinterop - mkdir build - cd build - rm -rf realmLinuxBuild - mkdir realmLinuxBuild - cd realmLinuxBuild - cmake -DCMAKE_BUILD_TYPE=Release \ - -DREALM_ENABLE_SYNC=1 \ - -DREALM_NO_TESTS=1 \ - -DREALM_BUILD_LIB_ONLY=true \ - ../../src/jvm - make -j8 - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} - path: ./packages/cinterop/build/realmLinuxBuild/librealmc.so - retention-days: 1 - - build-jvm-windows-native-lib: - runs-on: windows-latest - needs: [check-cache, build-jni-swig-stub] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - needs.check-cache.outputs.jni-windows-lib-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - # TODO See https://github.com/microsoft/vcpkg/issues/25349 which might describe the error here https://github.com/realm/realm-kotlin/runs/8099890473?check_suite_focus=true - # -- Building for: Visual Studio 17 2022 - # -- Running vcpkg install - # Error: while checking out port openssl with git tree 7e4d802e3bde4154c227c0dd1da75c719be9f07a - # Error: Failed to tar port directory - # error: tar failed with exit code: (128). - # fatal: not a tree object: 7e4d802e3bde4154c227c0dd1da75c719be9f07a - # TODO Implement better work-around here: https://mongodb.slack.com/archives/C017MBM0A30/p1661889411467029?thread_ts=1661888738.117769&cid=C017MBM0A30 - fetch-depth: 0 - submodules: "recursive" - - - name: Setup build cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmWindowsBuild - key: jni-windows-lib-${{ needs.check-cache.outputs.packages-sha }} - enableCrossOsArchive: true - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v4 - with: - name: jni-stub-${{ needs.check-cache.outputs.version-label }} - path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni - - - name: Build native lib - shell: powershell - working-directory: packages - run: | - cd cinterop - mkdir build - cd build - Remove-Item -Path realmWindowsBuild -Force -Recurse -ErrorAction Ignore - mkdir realmWindowsBuild - cd realmWindowsBuild - cmake ` - ..\..\src\jvm ` - -DCMAKE_GENERATOR_PLATFORM=x64 ` - -DCMAKE_BUILD_TYPE=Release ` - -DREALM_ENABLE_SYNC=ON ` - -DREALM_NO_TESTS=1 ` - -DVCPKG_TARGET_TRIPLET=x64-windows-static - cmake --build . --config Release - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} - path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll - retention-days: 1 - - build-jvm-macos-native-lib: - runs-on: macos-12 - needs: [check-cache, build-jni-swig-stub] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - needs.check-cache.outputs.jni-macos-lib-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'jvm-macos-native-lib' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - - name: Debug environment - run: | - env - type cmake - cmake --version - type ninja - ninja --version - - # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - - name: Setup build cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmMacOsBuild - key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} - - - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v4 - with: - name: jni-stub-${{ needs.check-cache.outputs.version-label }} - path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni - - - name: Build packages - working-directory: packages - run: ./gradlew buildJVMSharedLibs -Prealm.kotlin.mainHost=false - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} - path: ./packages/cinterop/build/realmMacOsBuild/librealmc.dylib - retention-days: 1 - - build-kotlin-metadata-package: - runs-on: ubuntu-latest - needs: [check-cache] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - needs.check-cache.outputs.packages-metadata-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'metadata-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? - - name: Setup NDK - uses: nttld/setup-ndk@v1 - with: - ndk-version: r23c - - - name: Setup build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-metadata-${{ needs.check-cache.outputs.packages-sha }} - - - name: Build Kotlin Metadata and Gradle and Compiler Plugin - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - - # This task is also responsible for creating the Gradle and Compiler Plugin as well as - # all Kotlin Multiplatform Metadata - build-jvm-packages: - runs-on: macos-12 - needs: [check-cache, build-jvm-linux-native-lib, build-jvm-windows-native-lib, build-jvm-macos-native-lib] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - needs.check-cache.outputs.packages-jvm-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'jvm-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? - - name: Setup NDK - uses: nttld/setup-ndk@v1 - with: - ndk-version: r23c - - # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - - name: Setup build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} - - - name: Restore Linux JNI lib - uses: actions/download-artifact@v4 - with: - name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} - path: ./packages/cinterop/build/realmLinuxBuild - - - name: Restore Windows JNI lib - uses: actions/download-artifact@v4 - with: - name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} - path: ./packages/cinterop/build/realmWindowsBuild/Release - - - name: Restore MacOS JNI lib - uses: actions/download-artifact@v4 - with: - name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} - path: ./packages/cinterop/build/realmMacOsBuild - - - name: Build JVM Package - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false - - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - - build-android-packages: - runs-on: ubuntu-latest - needs: check-cache - outputs: - baas-container-id: ${{ steps.baas_cli_start.outputs.baas_container_id }} - if: | - always() && !cancelled() && - (needs.check-cache.outputs.packages-android-cache-hit != 'true' || - needs.check-cache.outputs.android-test-base-apk-cache-hit != 'true' || - needs.check-cache.outputs.android-test-sync-apk-cache-hit != 'true') - - steps: - - name: Remove unnecessary files - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - # Manually install SWIG 4.1.1 as only 4.0.2 is pre-installed - # 4.1.1 is not available in apt-get, so use brew instead - # We need to use the formulae directly from GitHub to pin the version as Homebrew does not have - # all versions available. - # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts - # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. - - name: Install SWIG - run: | - test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" - test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile - echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile - echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH - echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH - cd ~ - curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb - - - name: Install JSON parser - run: brew install jq - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'android-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? - - name: Setup NDK - uses: nttld/setup-ndk@v1 - with: - ndk-version: r23c - - - name: Build Android Base Test Apk - working-directory: packages - run: ./gradlew :test-base:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - - - name: Build Android Sync Test Apk - working-directory: packages - run: ./gradlew :test-sync:packageDebug :test-sync:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - - - name: Build packages - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - - - name: Store build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-android-sync-${{ needs.check-cache.outputs.packages-sha }} - - - name: Store build cache for Android Test APK - uses: actions/cache@v4 - with: - path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - key: android-base-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} - - # Must match naming found in include-check-cache.yml - - name: Store build cache for Android Sync Test APK - uses: actions/cache@v4 - with: - key: android-sync-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} - path: | - ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - # Must match naming found in include-check-cache.yml - # Must match naming found in include-check-cache.yml - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-android-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - - name: Upload Android Base Test APK - uses: actions/upload-artifact@v4 - with: - name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} - path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - retention-days: 1 - - - name: Upload Android Sync Test APK - uses: actions/upload-artifact@v4 - with: - name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} - retention-days: 1 - path: | - ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - - # TODO: ccache is not being used by this build for some reason - build-macos-x64-packages: - runs-on: macos-12 - needs: check-cache - if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-x64-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'macos-x64-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - - name: Build packages - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false - - # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - - name: Store build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-macos-x64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # Must match naming found in include-check-cache.yml - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - build-macos-arm64-packages: - runs-on: macos-12 - needs: check-cache - # needs: static-analysis - if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-arm64-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'macos-arm64-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - - name: Build packages - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false - - - name: Store build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-macos-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # Must match naming found in include-check-cache.yml - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - build-ios-x64-packages: - runs-on: macos-12 - needs: check-cache - # needs: static-analysis - if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-x64-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'ios-x64-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - - name: Build packages - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosX64 -Prealm.kotlin.mainHost=false - - # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - - name: Store build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-ios-x64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # Must match naming found in include-check-cache.yml - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - build-ios-arm64-packages: - runs-on: macos-12 - needs: check-cache - # needs: static-analysis - if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-arm64-cache-hit != 'true' - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 - with: - cmake-version: ${{ vars.VERSION_CMAKE }} - - - name: Setup ninja - uses: cmelchior/setup-ninja@master - with: - version: ${{ vars.VERSION_NINJA }} + # build-jvm-linux-native-lib: + # runs-on: ubuntu-latest + # needs: [check-cache, build-jni-swig-stub] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # needs.check-cache.outputs.jni-linux-lib-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/cinterop/build/realmLinuxBuild + # key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Restore JNI Swig Stubs + # uses: actions/download-artifact@v4 + # with: + # name: jni-stub-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/jni-swig-stub/build/generated/sources/jni + + # - name: Build Docker image + # uses: docker/build-push-action@v3 + # with: + # tags: jvm-native-lib-linux:latest + # file: ./packages/cinterop/src/jvmMain/generic.Dockerfile + # push: false + + # - name: Build native lib + # uses: addnab/docker-run-action@v3 + # with: + # image: jvm-native-lib-linux:latest + # shell: bash + # options: -v ${{ github.workspace }}:/work + # run: | + # cd /work/packages/cinterop + # mkdir build + # cd build + # rm -rf realmLinuxBuild + # mkdir realmLinuxBuild + # cd realmLinuxBuild + # cmake -DCMAKE_BUILD_TYPE=Release \ + # -DREALM_ENABLE_SYNC=1 \ + # -DREALM_NO_TESTS=1 \ + # -DREALM_BUILD_LIB_ONLY=true \ + # ../../src/jvm + # make -j8 + + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/cinterop/build/realmLinuxBuild/librealmc.so + # retention-days: 1 + + # build-jvm-windows-native-lib: + # runs-on: windows-latest + # needs: [check-cache, build-jni-swig-stub] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # needs.check-cache.outputs.jni-windows-lib-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # # TODO See https://github.com/microsoft/vcpkg/issues/25349 which might describe the error here https://github.com/realm/realm-kotlin/runs/8099890473?check_suite_focus=true + # # -- Building for: Visual Studio 17 2022 + # # -- Running vcpkg install + # # Error: while checking out port openssl with git tree 7e4d802e3bde4154c227c0dd1da75c719be9f07a + # # Error: Failed to tar port directory + # # error: tar failed with exit code: (128). + # # fatal: not a tree object: 7e4d802e3bde4154c227c0dd1da75c719be9f07a + # # TODO Implement better work-around here: https://mongodb.slack.com/archives/C017MBM0A30/p1661889411467029?thread_ts=1661888738.117769&cid=C017MBM0A30 + # fetch-depth: 0 + # submodules: "recursive" + + # - name: Setup build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/cinterop/build/realmWindowsBuild + # key: jni-windows-lib-${{ needs.check-cache.outputs.packages-sha }} + # enableCrossOsArchive: true + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Restore JNI Swig Stubs + # uses: actions/download-artifact@v4 + # with: + # name: jni-stub-${{ needs.check-cache.outputs.version-label }} + # path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni + + # - name: Build native lib + # shell: powershell + # working-directory: packages + # run: | + # cd cinterop + # mkdir build + # cd build + # Remove-Item -Path realmWindowsBuild -Force -Recurse -ErrorAction Ignore + # mkdir realmWindowsBuild + # cd realmWindowsBuild + # cmake ` + # ..\..\src\jvm ` + # -DCMAKE_GENERATOR_PLATFORM=x64 ` + # -DCMAKE_BUILD_TYPE=Release ` + # -DREALM_ENABLE_SYNC=ON ` + # -DREALM_NO_TESTS=1 ` + # -DVCPKG_TARGET_TRIPLET=x64-windows-static + # cmake --build . --config Release + + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll + # retention-days: 1 + + # build-jvm-macos-native-lib: + # runs-on: macos-12 + # needs: [check-cache, build-jni-swig-stub] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # needs.check-cache.outputs.jni-macos-lib-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} + + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'jvm-macos-native-lib' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # - name: Debug environment + # run: | + # env + # type cmake + # cmake --version + # type ninja + # ninja --version + + # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + # - name: Setup build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/cinterop/build/realmMacOsBuild + # key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} + + # - name: Restore JNI Swig Stubs + # uses: actions/download-artifact@v4 + # with: + # name: jni-stub-${{ needs.check-cache.outputs.version-label }} + # path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni + + # - name: Build packages + # working-directory: packages + # run: ./gradlew buildJVMSharedLibs -Prealm.kotlin.mainHost=false + + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/cinterop/build/realmMacOsBuild/librealmc.dylib + # retention-days: 1 + + # build-kotlin-metadata-package: + # runs-on: ubuntu-latest + # needs: [check-cache] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # needs.check-cache.outputs.packages-metadata-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} + + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'metadata-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # # This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? + # - name: Setup NDK + # uses: nttld/setup-ndk@v1 + # with: + # ndk-version: r23c + + # - name: Setup build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-metadata-${{ needs.check-cache.outputs.packages-sha }} + + # - name: Build Kotlin Metadata and Gradle and Compiler Plugin + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true + + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + + # # This task is also responsible for creating the Gradle and Compiler Plugin as well as + # # all Kotlin Multiplatform Metadata + # build-jvm-packages: + # runs-on: macos-12 + # needs: [check-cache, build-jvm-linux-native-lib, build-jvm-windows-native-lib, build-jvm-macos-native-lib] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # needs.check-cache.outputs.packages-jvm-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} + + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'jvm-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? + # - name: Setup NDK + # uses: nttld/setup-ndk@v1 + # with: + # ndk-version: r23c + + # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + # - name: Setup build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} + + # - name: Restore Linux JNI lib + # uses: actions/download-artifact@v4 + # with: + # name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/cinterop/build/realmLinuxBuild + + # - name: Restore Windows JNI lib + # uses: actions/download-artifact@v4 + # with: + # name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/cinterop/build/realmWindowsBuild/Release + + # - name: Restore MacOS JNI lib + # uses: actions/download-artifact@v4 + # with: + # name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/cinterop/build/realmMacOsBuild + + # - name: Build JVM Package + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false + + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + + # build-android-packages: + # runs-on: ubuntu-latest + # needs: check-cache + # outputs: + # baas-container-id: ${{ steps.baas_cli_start.outputs.baas_container_id }} + # if: | + # always() && !cancelled() && + # (needs.check-cache.outputs.packages-android-cache-hit != 'true' || + # needs.check-cache.outputs.android-test-base-apk-cache-hit != 'true' || + # needs.check-cache.outputs.android-test-sync-apk-cache-hit != 'true') + + # steps: + # - name: Remove unnecessary files + # run: | + # sudo rm -rf /usr/share/dotnet + # sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Register problem matchers + # run: |- + # echo "::add-matcher::.github/problem-matchers/kotlin.json" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # # Manually install SWIG 4.1.1 as only 4.0.2 is pre-installed + # # 4.1.1 is not available in apt-get, so use brew instead + # # We need to use the formulae directly from GitHub to pin the version as Homebrew does not have + # # all versions available. + # # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts + # # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. + # - name: Install SWIG + # run: | + # test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" + # test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + # test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile + # echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile + # echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH + # echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + # cd ~ + # curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb + + # - name: Install JSON parser + # run: brew install jq + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 - with: - key: 'ios-arm64-package' - max-size: '2.0G' - - - name: Prepend ccache executables to the PATH - run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # See https://github.com/hendrikmuhs/ccache-action/issues/94 - - name: Configure ccache - run: | - ccache --set-config="compiler_check=content" - ccache --show-config - echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - - name: Build packages - working-directory: packages - run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosArm64 -Prealm.kotlin.mainHost=false - - # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - - name: Store build cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-ios-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # Must match naming found in include-check-cache.yml - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - - # TODO Split into base and sync tests - # TODO If we hook up to Device Farm we can use ubuntu runners instead - # TODO Compare speed between emulator and Device Farm - # TODO We should be able to move this into a reusable work-flow - - # TODO Compare speed between emulator and Device Farm - # TODO We should be able to move this into a reusable work-flow - test-android-packages-emulator: - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - type: [base, sync] - include: - - type: base - test-title: Unit Test Results - Android Base (Emulator) - - type: sync - test-title: Unit Test Results - Android Sync (Emulator) + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'android-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? + # - name: Setup NDK + # uses: nttld/setup-ndk@v1 + # with: + # ndk-version: r23c + + # - name: Build Android Base Test Apk + # working-directory: packages + # run: ./gradlew :test-base:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false + + # - name: Build Android Sync Test Apk + # working-directory: packages + # run: ./gradlew :test-sync:packageDebug :test-sync:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false + + # - name: Build packages + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false + + # - name: Store build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-android-sync-${{ needs.check-cache.outputs.packages-sha }} + + # - name: Store build cache for Android Test APK + # uses: actions/cache@v4 + # with: + # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + # key: android-base-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} + + # # Must match naming found in include-check-cache.yml + # - name: Store build cache for Android Sync Test APK + # uses: actions/cache@v4 + # with: + # key: android-sync-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} + # path: | + # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + # # Must match naming found in include-check-cache.yml + # # Must match naming found in include-check-cache.yml + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-android-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # - name: Upload Android Base Test APK + # uses: actions/upload-artifact@v4 + # with: + # name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + # retention-days: 1 + + # - name: Upload Android Sync Test APK + # uses: actions/upload-artifact@v4 + # with: + # name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} + # retention-days: 1 + # path: | + # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + + # # TODO: ccache is not being used by this build for some reason + # build-macos-x64-packages: + # runs-on: macos-12 + # needs: check-cache + # if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-x64-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} - runs-on: macos-12 - needs: [check-cache, build-android-packages, build-jvm-packages, build-kotlin-metadata-package] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: "recursive" - - # checkout BAAS CLI repo - - name: Checkout BAAS repo - if: matrix.type == 'sync' - run: | - echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - gh repo clone 10gen/baasaas - - # Start BAAS instance in the background - # We save the container id to poll against and get the hostname info later - - name: Start Baas instance in the background - id: baas_cli_start - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # curl: option --data: error encountered when reading a file - OUTPUT=$(bash cli.sh start | jq -r '.id') - echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v4 - with: - name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore m2-buildrepo (Android) - uses: actions/download-artifact@v4 - with: - name: packages-android-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore m2-buildrepo (JVM) - uses: actions/download-artifact@v4 - with: - name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - - name: Fetching the BAAS CLI hostname - id: baas_cli_poll - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # TODO This action does not support using `\` to split multiline scripts. - - name: Run Integration Tests - env: - SSH_AUTH_SOCK: /tmp/ssh_agent.sock - uses: reactivecircus/android-emulator-runner@v2 - with: - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - api-level: ${{ vars.VERSION_ANDROID_EMULATOR_API_LEVEL }} # Must be 30 to support aosp_atd - target: default - arch: x86_64 - disk-size: 4096M - ram-size: 2048M - heap-size: 1024M - channel: canary - script: | - adb logcat -c - adb logcat > logcat.txt & - cd packages && ./gradlew :test-${{ matrix.type }}:connectedCheck -PsyncUsePlatformNetworking=true -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} -PincludeSdkModules=false --info --no-daemon - - - name: Archive LogCat data - uses: actions/upload-artifact@v4 - if: always() || failure() - with: - name: logcat-${{ matrix.type }}-emulator.txt - path: logcat.txt - retention-days: 1 - - - name: Publish Unit Test Results - uses: dorny/test-reporter@v1 - if: always() || failure() - with: - name: ${{ matrix.test-title }} - path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - reporter: java-junit - list-suites: failed - list-tests: failed - fail-on-error: true - - - name: Stopping the BAAS container - if: always() && matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - fi - - # Disable device farm test for Base, because running two in parallel seems to interfer somehow - test-android-packages-device-farm: - name: AWS Device Farm - timeout-minutes: 60 - runs-on: ubuntu-latest - needs: [ check-cache, build-android-packages, build-jvm-packages ] - if: | - false && - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Restore Android Test APK - uses: actions/download-artifact@v4 - with: - name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} - path: ./packages/test-base/build/outputs/apk/androidTest/debug - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Run the tests - uses: ./.github/actions/run-android-device-farm-test - id: run_android_tests - with: - apk-path: ${{ github.workspace }}/packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - app-id: io.realm.testapp - project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} - device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} - - - test-android-packages-device-farm-sync: - name: AWS Device Farm Sync Tests - timeout-minutes: 60 - runs-on: ubuntu-latest - needs: [ check-cache, build-android-packages, build-jvm-packages ] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # checkout BAAS CLI repo - - name: Checkout BAAS repo - run: | - echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - gh repo clone 10gen/baasaas - - # Start BAAS instance in the background - # We save the container id to poll against and get the hostname info later - - name: Start Baas instance in the background - id: baas_cli_start - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - OUTPUT=$(bash cli.sh start | jq -r '.id') - echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Restore Android Sync Test APK - uses: actions/download-artifact@v4 - with: - name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} - path: ./packages/test-sync/build/outputs/apk/ - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - - name: Fetching the BAAS CLI hostname - id: baas_cli_poll - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Run the Sync tests - uses: ./.github/actions/run-android-device-farm-test - id: run_android_tests - with: - apk-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - apk-auxiliary-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - baas_url: ${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - app-id: io.realm.sync.testapp.test - project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} - device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} - - - name: Stopping the BAAS container - if: always() - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - fi - - test-macos-packages: - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - os: [macos-12] # , macos-arm] - type: [base, sync] - include: - - os: macos-12 - type: base - os-id: macos - package-prefix: macos-x64 - test-title: Unit Test Results - MacOS x64 Base - - os: macos-12 - type: sync - os-id: macos - package-prefix: macos-x64 - test-title: Unit Test Results - MacOS x64 Sync - # - os: macos-arm - # package-prefix: macos-arm64 - # test-title: Results - MacOS arm64 Base + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'macos-x64-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # - name: Build packages + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false + + # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + # - name: Store build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-macos-x64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # # Must match naming found in include-check-cache.yml + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # build-macos-arm64-packages: + # runs-on: macos-12 + # needs: check-cache + # # needs: static-analysis + # if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-arm64-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} - runs-on: ${{ matrix.os }} - # TODO Unclear why MacOS needs the metadata package when the Android Tests do not - # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. - needs: [check-cache, build-macos-x64-packages, build-kotlin-metadata-package] #, build-macos-arm64-packages] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # checkout BAAS CLI repo - - name: Checkout BAAS repo - if: matrix.type == 'sync' - run: | - echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - gh repo clone 10gen/baasaas - - # Start BAAS instance in the background - # We save the container id to poll against and get the hostname info later - - name: Start Baas instance in the background - id: baas_cli_start - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # curl: option --data: error encountered when reading a file - OUTPUT=$(bash cli.sh start | jq -r '.id') - echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Restore m2-buildrepo - uses: actions/download-artifact@v4 - with: - name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v4 - with: - name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - - name: Fetching the BAAS CLI hostname - id: baas_cli_poll - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Run tests - working-directory: packages - run: > - ./gradlew :test-${{ matrix.type }}:macosTest - -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - -PincludeSdkModules=false - --info --no-daemon - - - name: Publish Unit Test Results - uses: dorny/test-reporter@v1 - if: always() || failure() - with: - name: ${{ matrix.test-title }} - path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - reporter: java-junit - list-suites: failed - list-tests: failed - fail-on-error: true - - - name: Stopping the BAAS container - if: always() && matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - fi - - - test-ios-packages: - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - os: [macos-12] # , macos-arm] - type: [base, sync] - include: - - os: macos-12 - type: base - package-prefix: x64 - test-title: Unit Test Results - iOS x64 Base - test-task: iosTest - - os: macos-12 - type: sync - package-prefix: x64 - test-title: Unit Test Results - iOS x64 Sync - test-task: iosTest - # - os: macos-arm - # package-prefix: macos-arm64 - # test-title: Results - MacOS arm64 Base + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'macos-arm64-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # - name: Build packages + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false + + # - name: Store build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-macos-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # # Must match naming found in include-check-cache.yml + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # build-ios-x64-packages: + # runs-on: macos-12 + # needs: check-cache + # # needs: static-analysis + # if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-x64-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} - runs-on: ${{ matrix.os }} - # TODO Unclear why MacOS needs the metadata package when the Android Tests do not - # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. - needs: [check-cache, build-ios-x64-packages, build-kotlin-metadata-package] # , build-ios-arm64-packages] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # checkout BAAS CLI repo - - name: Checkout BAAS repo - if: matrix.type == 'sync' - run: | - echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - gh repo clone 10gen/baasaas - - # Start BAAS instance in the background - # We save the container id to poll against and get the hostname info later - - name: Start Baas instance in the background - id: baas_cli_start - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # curl: option --data: error encountered when reading a file - OUTPUT=$(bash cli.sh start | jq -r '.id') - echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Restore m2-buildrepo (ios) - uses: actions/download-artifact@v4 - with: - name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v4 - with: - name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - - name: Fetching the BAAS CLI hostname - id: baas_cli_poll - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. - - name: Run tests - working-directory: packages - run: > - ./gradlew :test-${{ matrix.type }}:${{ matrix.test-task }} - -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - -PincludeSdkModules=false - --info --no-daemon - - - name: Publish Unit Test Results - uses: dorny/test-reporter@v1 - if: always() || failure() - with: - name: ${{ matrix.test-title }} - path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - reporter: java-junit - list-suites: failed - list-tests: failed - fail-on-error: true - - - name: Stopping the BAAS container - if: always() && matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - fi - - test-jvm-packages: - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - os: [macos-12, ubuntu-latest, windows-latest] # TODO Should we also test om MacOS arm64? - type: [base, sync] - include: - - os: macos-12 - os-id: mac - type: base - test-title: Unit Test Results - Base JVM MacOS x64 - - os: ubuntu-latest - os-id: ubu - type: base - test-title: Unit Test Results - Base JVM Linux - - os: windows-latest - os-id: win - type: base - test-title: Unit Test Results - Base JVM Windows - - os: macos-12 - os-id: mac - type: sync - test-title: Unit Test Results - Sync JVM MacOS x64 - - os: ubuntu-latest - os-id: ubu - type: sync - test-title: Unit Test Results - Sync JVM Linux - exclude: - # Do not run Windows Sync Tests, because the bash script for - # starting the BAAS container doesn not work on Windows. - - os: windows-latest - #os-id: win - type: sync - #test-title: Unit Test Results - Sync JVM Windows - - runs-on: ${{ matrix.os }} - needs: [check-cache, build-jvm-packages, build-kotlin-metadata-package] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # checkout BAAS CLI repo - - name: Checkout BAAS repo - if: matrix.type == 'sync' - run: | - echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - gh repo clone 10gen/baasaas - - # Start BAAS instance in the background - # We save the container id to poll against and get the hostname info later - - name: Start Baas instance in the background - id: baas_cli_start - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # curl: option --data: error encountered when reading a file - OUTPUT=$(bash cli.sh start | jq -r '.id') - echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - - name: Setup Java 11 - uses: actions/setup-java@v4 - with: - distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - java-version: ${{ vars.VERSION_JAVA }} - - - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - with: - cache-read-only: false - - - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v4 - with: - name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore m2-buildrepo - uses: actions/download-artifact@v4 - with: - name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - - name: Fetching the BAAS CLI hostname - id: baas_cli_poll - if: matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. - - name: Run tests - working-directory: packages - run: > - ./gradlew :test-${{ matrix.type }}:jvmTest - -PsyncUsePlatformNetworking=true - -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - -PincludeSdkModules=false - --info --no-daemon - - - name: Publish Unit Test Results - uses: dorny/test-reporter@v1 - if: always() || failure() - with: - name: ${{ matrix.test-title }} - path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - reporter: java-junit - list-suites: failed - list-tests: failed - fail-on-error: true - - - name: Stopping the BAAS container - if: always() && matrix.type == 'sync' - working-directory: baasaas - env: - APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - run: | - if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - fi - - package-all-artifacts: - runs-on: ubuntu-latest - needs: [check-cache, build-jvm-packages, build-android-packages, build-macos-x64-packages, build-macos-arm64-packages, build-ios-x64-packages, build-ios-arm64-packages, build-kotlin-metadata-package] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # The Metadata artifact contain broken JVM publications, so it needs to be - # restored first, it so they can be overidden with the correct ones. - - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v4 - with: - name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore Android artifacts - uses: actions/download-artifact@v4 - with: - name: packages-android-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore JVM artifacts - uses: actions/download-artifact@v4 - with: - name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore MacOS x64 artifacts - uses: actions/download-artifact@v4 - with: - name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore MacOS arm64 artifacts - uses: actions/download-artifact@v4 - with: - name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore iOS x64 artifacts - uses: actions/download-artifact@v4 - with: - name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Restore iOS arm64 artifacts - uses: actions/download-artifact@v4 - with: - name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - - - name: Upload artifacts bundle - uses: actions/upload-artifact@v4 - with: - name: all-packages-${{ needs.check-cache.outputs.version-label }} - path: ./packages/build/m2-buildrepo - retention-days: 7 - - integration-tests: - uses: ./.github/workflows/include-integration-tests.yml - needs: [check-cache, package-all-artifacts] - if: | - always() && - !cancelled() && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') - with: - version-label: ${{ needs.check-cache.outputs.version-label }} - - deploy-snapshot: - uses: ./.github/workflows/include-deploy-snapshot.yml - needs: [ - check-cache, - static-analysis, - integration-tests, - test-jvm-packages, - test-macos-packages, - test-ios-packages, - test-android-packages-emulator, - # test-android-packages-device-farm, - test-android-packages-device-farm-sync, - package-all-artifacts - ] - if: | - always() && - !cancelled() && - endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') - - secrets: inherit - with: - version-label: ${{ needs.check-cache.outputs.version-label }} - - # This job sets an output `is_publish_build` to `true` if this is a release build - check-release-build: - runs-on: ubuntu-latest - needs: [check-cache] - outputs: - is_publish_build: ${{ steps.check_release.outputs.is_publish_build }} - - steps: - - uses: actions/checkout@v4 - - - name: Check if release build - id: check_release - run: | - git fetch --tags - gitTag=$(git describe --tags --exact-match HEAD) || echo "NONE" - echo "Git branch/tag: ${GITHUB_REF}/${gitTag:-'none'}" - - if [[ -z "$gitTag" ]]; then - gitSha=$(git rev-parse HEAD | cut -c1-8) - echo "Building commit: ${{ needs.check-cache.outputs.version-label }} - ${gitSha}" - echo "is_publish_build=false" >> $GITHUB_OUTPUT - else - if [[ "$gitTag" != "v${{ needs.check-cache.outputs.version-label }}" ]]; then - echo "Git tag '${gitTag}' does not match v${{ needs.check-cache.outputs.version-label }}" - echo "is_publish_build=false" >> $GITHUB_OUTPUT - else - echo "Building release: '${gitTag}'" - echo "is_publish_build=true" >> $GITHUB_OUTPUT - fi - fi + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'ios-x64-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # - name: Build packages + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosX64 -Prealm.kotlin.mainHost=false + + # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + # - name: Store build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-ios-x64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # # Must match naming found in include-check-cache.yml + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # build-ios-arm64-packages: + # runs-on: macos-12 + # needs: check-cache + # # needs: static-analysis + # if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-arm64-cache-hit != 'true' + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Setup cmake + # uses: jwlawson/actions-setup-cmake@v1.13 + # with: + # cmake-version: ${{ vars.VERSION_CMAKE }} + + # - name: Setup ninja + # uses: cmelchior/setup-ninja@master + # with: + # version: ${{ vars.VERSION_NINJA }} + + # - name: Install ccache + # uses: hendrikmuhs/ccache-action@v1.2.2 + # with: + # key: 'ios-arm64-package' + # max-size: '2.0G' + + # - name: Prepend ccache executables to the PATH + # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # # See https://github.com/hendrikmuhs/ccache-action/issues/94 + # - name: Configure ccache + # run: | + # ccache --set-config="compiler_check=content" + # ccache --show-config + # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # - name: Build packages + # working-directory: packages + # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosArm64 -Prealm.kotlin.mainHost=false + + # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + # - name: Store build cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-ios-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # # Must match naming found in include-check-cache.yml + # - name: Upload artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + + # # TODO Split into base and sync tests + # # TODO If we hook up to Device Farm we can use ubuntu runners instead + # # TODO Compare speed between emulator and Device Farm + # # TODO We should be able to move this into a reusable work-flow + + # # TODO Compare speed between emulator and Device Farm + # # TODO We should be able to move this into a reusable work-flow + # test-android-packages-emulator: + # timeout-minutes: 60 + # strategy: + # fail-fast: false + # matrix: + # type: [base, sync] + # include: + # - type: base + # test-title: Unit Test Results - Android Base (Emulator) + # - type: sync + # test-title: Unit Test Results - Android Sync (Emulator) + + # runs-on: macos-12 + # needs: [check-cache, build-android-packages, build-jvm-packages, build-kotlin-metadata-package] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # submodules: "recursive" + + # # checkout BAAS CLI repo + # - name: Checkout BAAS repo + # if: matrix.type == 'sync' + # run: | + # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + # gh repo clone 10gen/baasaas + + # # Start BAAS instance in the background + # # We save the container id to poll against and get the hostname info later + # - name: Start Baas instance in the background + # id: baas_cli_start + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # # curl: option --data: error encountered when reading a file + # OUTPUT=$(bash cli.sh start | jq -r '.id') + # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Restore Kotlin metadata artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore m2-buildrepo (Android) + # uses: actions/download-artifact@v4 + # with: + # name: packages-android-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore m2-buildrepo (JVM) + # uses: actions/download-artifact@v4 + # with: + # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + # - name: Fetching the BAAS CLI hostname + # id: baas_cli_poll + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # # TODO This action does not support using `\` to split multiline scripts. + # - name: Run Integration Tests + # env: + # SSH_AUTH_SOCK: /tmp/ssh_agent.sock + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + # disable-animations: true + # api-level: ${{ vars.VERSION_ANDROID_EMULATOR_API_LEVEL }} # Must be 30 to support aosp_atd + # target: default + # arch: x86_64 + # disk-size: 4096M + # ram-size: 2048M + # heap-size: 1024M + # channel: canary + # script: | + # adb logcat -c + # adb logcat > logcat.txt & + # cd packages && ./gradlew :test-${{ matrix.type }}:connectedCheck -PsyncUsePlatformNetworking=true -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} -PincludeSdkModules=false --info --no-daemon + + # - name: Archive LogCat data + # uses: actions/upload-artifact@v4 + # if: always() || failure() + # with: + # name: logcat-${{ matrix.type }}-emulator.txt + # path: logcat.txt + # retention-days: 1 + + # - name: Publish Unit Test Results + # uses: dorny/test-reporter@v1 + # if: always() || failure() + # with: + # name: ${{ matrix.test-title }} + # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + # reporter: java-junit + # list-suites: failed + # list-tests: failed + # fail-on-error: true + + # - name: Stopping the BAAS container + # if: always() && matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + # fi + + # # Disable device farm test for Base, because running two in parallel seems to interfer somehow + # test-android-packages-device-farm: + # name: AWS Device Farm + # timeout-minutes: 60 + # runs-on: ubuntu-latest + # needs: [ check-cache, build-android-packages, build-jvm-packages ] + # if: | + # false && + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - name: Restore Android Test APK + # uses: actions/download-artifact@v4 + # with: + # name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/test-base/build/outputs/apk/androidTest/debug + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} + # aws-region: us-west-2 + + # - name: Run the tests + # uses: ./.github/actions/run-android-device-farm-test + # id: run_android_tests + # with: + # apk-path: ${{ github.workspace }}/packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + # app-id: io.realm.testapp + # project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} + # device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} + + + # test-android-packages-device-farm-sync: + # name: AWS Device Farm Sync Tests + # timeout-minutes: 60 + # runs-on: ubuntu-latest + # needs: [ check-cache, build-android-packages, build-jvm-packages ] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # # checkout BAAS CLI repo + # - name: Checkout BAAS repo + # run: | + # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + # gh repo clone 10gen/baasaas + + # # Start BAAS instance in the background + # # We save the container id to poll against and get the hostname info later + # - name: Start Baas instance in the background + # id: baas_cli_start + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # OUTPUT=$(bash cli.sh start | jq -r '.id') + # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Restore Android Sync Test APK + # uses: actions/download-artifact@v4 + # with: + # name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/test-sync/build/outputs/apk/ + + # - name: Configure AWS Credentials + # uses: aws-actions/configure-aws-credentials@v1 + # with: + # aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} + # aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} + # aws-region: us-west-2 + + # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + # - name: Fetching the BAAS CLI hostname + # id: baas_cli_poll + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Run the Sync tests + # uses: ./.github/actions/run-android-device-farm-test + # id: run_android_tests + # with: + # apk-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + # apk-auxiliary-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + # baas_url: ${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + # app-id: io.realm.sync.testapp.test + # project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} + # device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} + + # - name: Stopping the BAAS container + # if: always() + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + # fi + + # test-macos-packages: + # timeout-minutes: 60 + # strategy: + # fail-fast: false + # matrix: + # os: [macos-12] # , macos-arm] + # type: [base, sync] + # include: + # - os: macos-12 + # type: base + # os-id: macos + # package-prefix: macos-x64 + # test-title: Unit Test Results - MacOS x64 Base + # - os: macos-12 + # type: sync + # os-id: macos + # package-prefix: macos-x64 + # test-title: Unit Test Results - MacOS x64 Sync + # # - os: macos-arm + # # package-prefix: macos-arm64 + # # test-title: Results - MacOS arm64 Base + + # runs-on: ${{ matrix.os }} + # # TODO Unclear why MacOS needs the metadata package when the Android Tests do not + # # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. + # needs: [check-cache, build-macos-x64-packages, build-kotlin-metadata-package] #, build-macos-arm64-packages] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # # checkout BAAS CLI repo + # - name: Checkout BAAS repo + # if: matrix.type == 'sync' + # run: | + # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + # gh repo clone 10gen/baasaas + + # # Start BAAS instance in the background + # # We save the container id to poll against and get the hostname info later + # - name: Start Baas instance in the background + # id: baas_cli_start + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # # curl: option --data: error encountered when reading a file + # OUTPUT=$(bash cli.sh start | jq -r '.id') + # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Restore m2-buildrepo + # uses: actions/download-artifact@v4 + # with: + # name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore Kotlin metadata artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + + # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + # - name: Fetching the BAAS CLI hostname + # id: baas_cli_poll + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Run tests + # working-directory: packages + # run: > + # ./gradlew :test-${{ matrix.type }}:macosTest + # -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + # -PincludeSdkModules=false + # --info --no-daemon + + # - name: Publish Unit Test Results + # uses: dorny/test-reporter@v1 + # if: always() || failure() + # with: + # name: ${{ matrix.test-title }} + # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + # reporter: java-junit + # list-suites: failed + # list-tests: failed + # fail-on-error: true + + # - name: Stopping the BAAS container + # if: always() && matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + # fi + + + # test-ios-packages: + # timeout-minutes: 60 + # strategy: + # fail-fast: false + # matrix: + # os: [macos-12] # , macos-arm] + # type: [base, sync] + # include: + # - os: macos-12 + # type: base + # package-prefix: x64 + # test-title: Unit Test Results - iOS x64 Base + # test-task: iosTest + # - os: macos-12 + # type: sync + # package-prefix: x64 + # test-title: Unit Test Results - iOS x64 Sync + # test-task: iosTest + # # - os: macos-arm + # # package-prefix: macos-arm64 + # # test-title: Results - MacOS arm64 Base + + # runs-on: ${{ matrix.os }} + # # TODO Unclear why MacOS needs the metadata package when the Android Tests do not + # # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. + # needs: [check-cache, build-ios-x64-packages, build-kotlin-metadata-package] # , build-ios-arm64-packages] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # # checkout BAAS CLI repo + # - name: Checkout BAAS repo + # if: matrix.type == 'sync' + # run: | + # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + # gh repo clone 10gen/baasaas + + # # Start BAAS instance in the background + # # We save the container id to poll against and get the hostname info later + # - name: Start Baas instance in the background + # id: baas_cli_start + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # # curl: option --data: error encountered when reading a file + # OUTPUT=$(bash cli.sh start | jq -r '.id') + # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Restore m2-buildrepo (ios) + # uses: actions/download-artifact@v4 + # with: + # name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore Kotlin metadata artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + + # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + # - name: Fetching the BAAS CLI hostname + # id: baas_cli_poll + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. + # - name: Run tests + # working-directory: packages + # run: > + # ./gradlew :test-${{ matrix.type }}:${{ matrix.test-task }} + # -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + # -PincludeSdkModules=false + # --info --no-daemon + + # - name: Publish Unit Test Results + # uses: dorny/test-reporter@v1 + # if: always() || failure() + # with: + # name: ${{ matrix.test-title }} + # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + # reporter: java-junit + # list-suites: failed + # list-tests: failed + # fail-on-error: true + + # - name: Stopping the BAAS container + # if: always() && matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + # fi + + # test-jvm-packages: + # timeout-minutes: 60 + # strategy: + # fail-fast: false + # matrix: + # os: [macos-12, ubuntu-latest, windows-latest] # TODO Should we also test om MacOS arm64? + # type: [base, sync] + # include: + # - os: macos-12 + # os-id: mac + # type: base + # test-title: Unit Test Results - Base JVM MacOS x64 + # - os: ubuntu-latest + # os-id: ubu + # type: base + # test-title: Unit Test Results - Base JVM Linux + # - os: windows-latest + # os-id: win + # type: base + # test-title: Unit Test Results - Base JVM Windows + # - os: macos-12 + # os-id: mac + # type: sync + # test-title: Unit Test Results - Sync JVM MacOS x64 + # - os: ubuntu-latest + # os-id: ubu + # type: sync + # test-title: Unit Test Results - Sync JVM Linux + # exclude: + # # Do not run Windows Sync Tests, because the bash script for + # # starting the BAAS container doesn not work on Windows. + # - os: windows-latest + # #os-id: win + # type: sync + # #test-title: Unit Test Results - Sync JVM Windows + + # runs-on: ${{ matrix.os }} + # needs: [check-cache, build-jvm-packages, build-kotlin-metadata-package] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # # checkout BAAS CLI repo + # - name: Checkout BAAS repo + # if: matrix.type == 'sync' + # run: | + # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + # gh repo clone 10gen/baasaas + + # # Start BAAS instance in the background + # # We save the container id to poll against and get the hostname info later + # - name: Start Baas instance in the background + # id: baas_cli_start + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # # curl: option --data: error encountered when reading a file + # OUTPUT=$(bash cli.sh start | jq -r '.id') + # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + # - name: Setup Java 11 + # uses: actions/setup-java@v3 + # with: + # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + # java-version: ${{ vars.VERSION_JAVA }} + + # - name: Setup Gradle and task/dependency caching + # uses: gradle/gradle/actions/setup-gradle@v3 + # with: + # cache-read-only: false + + # - name: Restore Kotlin metadata artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore m2-buildrepo + # uses: actions/download-artifact@v4 + # with: + # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + # - name: Fetching the BAAS CLI hostname + # id: baas_cli_poll + # if: matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. + # - name: Run tests + # working-directory: packages + # run: > + # ./gradlew :test-${{ matrix.type }}:jvmTest + # -PsyncUsePlatformNetworking=true + # -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + # -PincludeSdkModules=false + # --info --no-daemon + + # - name: Publish Unit Test Results + # uses: dorny/test-reporter@v1 + # if: always() || failure() + # with: + # name: ${{ matrix.test-title }} + # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + # reporter: java-junit + # list-suites: failed + # list-tests: failed + # fail-on-error: true + + # - name: Stopping the BAAS container + # if: always() && matrix.type == 'sync' + # working-directory: baasaas + # env: + # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + # run: | + # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + # fi + + # package-all-artifacts: + # runs-on: ubuntu-latest + # needs: [check-cache, build-jvm-packages, build-android-packages, build-macos-x64-packages, build-macos-arm64-packages, build-ios-x64-packages, build-ios-arm64-packages, build-kotlin-metadata-package] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # # The Metadata artifact contain broken JVM publications, so it needs to be + # # restored first, it so they can be overidden with the correct ones. + # - name: Restore Kotlin metadata artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore Android artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-android-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore JVM artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore MacOS x64 artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore MacOS arm64 artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore iOS x64 artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Restore iOS arm64 artifacts + # uses: actions/download-artifact@v4 + # with: + # name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + + # - name: Upload artifacts bundle + # uses: actions/upload-artifact@v4 + # with: + # name: all-packages-${{ needs.check-cache.outputs.version-label }} + # path: ./packages/build/m2-buildrepo + # retention-days: 7 + + # integration-tests: + # uses: ./.github/workflows/include-integration-tests.yml + # needs: [check-cache, package-all-artifacts] + # if: | + # always() && + # !cancelled() && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') + # with: + # version-label: ${{ needs.check-cache.outputs.version-label }} + + # deploy-snapshot: + # uses: ./.github/workflows/include-deploy-snapshot.yml + # needs: [ + # check-cache, + # static-analysis, + # integration-tests, + # test-jvm-packages, + # test-macos-packages, + # test-ios-packages, + # test-android-packages-emulator, + # # test-android-packages-device-farm, + # test-android-packages-device-farm-sync, + # package-all-artifacts + # ] + # if: | + # always() && + # !cancelled() && + # endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') + + # secrets: inherit + # with: + # version-label: ${{ needs.check-cache.outputs.version-label }} + + # # This job sets an output `is_publish_build` to `true` if this is a release build + # check-release-build: + # runs-on: ubuntu-latest + # needs: [check-cache] + # outputs: + # is_publish_build: ${{ steps.check_release.outputs.is_publish_build }} + + # steps: + # - uses: actions/checkout@v4 + + # - name: Check if release build + # id: check_release + # run: | + # git fetch --tags + # gitTag=$(git describe --tags --exact-match HEAD) || echo "NONE" + # echo "Git branch/tag: ${GITHUB_REF}/${gitTag:-'none'}" + + # if [[ -z "$gitTag" ]]; then + # gitSha=$(git rev-parse HEAD | cut -c1-8) + # echo "Building commit: ${{ needs.check-cache.outputs.version-label }} - ${gitSha}" + # echo "is_publish_build=false" >> $GITHUB_OUTPUT + # else + # if [[ "$gitTag" != "v${{ needs.check-cache.outputs.version-label }}" ]]; then + # echo "Git tag '${gitTag}' does not match v${{ needs.check-cache.outputs.version-label }}" + # echo "is_publish_build=false" >> $GITHUB_OUTPUT + # else + # echo "Building release: '${gitTag}'" + # echo "is_publish_build=true" >> $GITHUB_OUTPUT + # fi + # fi - - name: Print is release build - run: | - echo "Is release build: ${{ steps.check_release.outputs.is_publish_build }}" + # - name: Print is release build + # run: | + # echo "Is release build: ${{ steps.check_release.outputs.is_publish_build }}" - deploy-release: + # deploy-release: uses: ./.github/workflows/include-deploy-release.yml needs: [ check-cache, From 1c925c56422308f4be98ef660f0540ae47b2cda6 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 22:17:55 +0200 Subject: [PATCH 18/74] Remove check cache dependency --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ffbccacdf5..7cf4636369 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,7 @@ jobs: # with SWIG if we compile on each seperate platform. build-jni-swig-stub: runs-on: ubuntu-latest - needs: check-cache + # needs: check-cache if: always() && !cancelled() && needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - name: Checkout code From 1bd97055965593b0439a0847bf25bafb6eb07080 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 22:22:52 +0200 Subject: [PATCH 19/74] Disable other jobs --- .github/workflows/pr.yml | 107 ++++++++++++++++++++------------------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7cf4636369..5993289169 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -28,12 +28,13 @@ jobs: # check-cache: # uses: ./.github/workflows/include-check-cache.yml + # We build the same JNI SWIG stub once and re-use it across platforms to ensure any problems # with SWIG if we compile on each seperate platform. build-jni-swig-stub: runs-on: ubuntu-latest - # needs: check-cache - if: always() && !cancelled() && needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' + needs: check-cache + if: always() && !cancelled() #&& needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - name: Checkout code uses: actions/checkout@v4 @@ -118,7 +119,7 @@ jobs: # cmake-version: ${{ vars.VERSION_CMAKE }} # - name: Restore JNI Swig Stubs - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: jni-stub-${{ needs.check-cache.outputs.version-label }} # path: ./packages/jni-swig-stub/build/generated/sources/jni @@ -195,7 +196,7 @@ jobs: # cmake-version: ${{ vars.VERSION_CMAKE }} # - name: Restore JNI Swig Stubs - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: jni-stub-${{ needs.check-cache.outputs.version-label }} # path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni @@ -296,7 +297,7 @@ jobs: # key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} # - name: Restore JNI Swig Stubs - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: jni-stub-${{ needs.check-cache.outputs.version-label }} # path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni @@ -460,19 +461,19 @@ jobs: # key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} # - name: Restore Linux JNI lib - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} # path: ./packages/cinterop/build/realmLinuxBuild # - name: Restore Windows JNI lib - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} # path: ./packages/cinterop/build/realmWindowsBuild/Release # - name: Restore MacOS JNI lib - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} # path: ./packages/cinterop/build/realmMacOsBuild @@ -980,19 +981,19 @@ jobs: # cache-read-only: false # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore m2-buildrepo (Android) - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-android-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore m2-buildrepo (JVM) - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo @@ -1075,7 +1076,7 @@ jobs: # uses: actions/checkout@v4 # - name: Restore Android Test APK - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} # path: ./packages/test-base/build/outputs/apk/androidTest/debug @@ -1129,7 +1130,7 @@ jobs: # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT # - name: Restore Android Sync Test APK - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} # path: ./packages/test-sync/build/outputs/apk/ @@ -1241,13 +1242,13 @@ jobs: # cache-read-only: false # - name: Restore m2-buildrepo - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo @@ -1363,13 +1364,13 @@ jobs: # cache-read-only: false # - name: Restore m2-buildrepo (ios) - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo @@ -1497,13 +1498,13 @@ jobs: # cache-read-only: false # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore m2-buildrepo - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo @@ -1566,43 +1567,43 @@ jobs: # # The Metadata artifact contain broken JVM publications, so it needs to be # # restored first, it so they can be overidden with the correct ones. # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore Android artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-android-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore JVM artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore MacOS x64 artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore MacOS arm64 artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore iOS x64 artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo # - name: Restore iOS arm64 artifacts - # uses: actions/download-artifact@v4 + # uses: actions/download-artifact@v3 # with: # name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} # path: ./packages/build/m2-buildrepo @@ -1688,30 +1689,30 @@ jobs: # echo "Is release build: ${{ steps.check_release.outputs.is_publish_build }}" # deploy-release: - uses: ./.github/workflows/include-deploy-release.yml - needs: [ - check-cache, - check-release-build, - static-analysis, - integration-tests, - test-jvm-packages, - test-macos-packages, - test-ios-packages, - test-android-packages-emulator, - # test-android-packages-device-farm, - test-android-packages-device-farm-sync, - package-all-artifacts - ] - if: | - always() && - !cancelled() && - !endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && - !contains(needs.*.result, 'failure') && - !contains(needs.*.result, 'cancelled') && - (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') && - (needs.check-release-build.outputs.is_publish_build == 'true') - - secrets: inherit - with: - version-label: ${{ needs.check-cache.outputs.version-label }} - packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }} + # uses: ./.github/workflows/include-deploy-release.yml + # needs: [ + # check-cache, + # check-release-build, + # static-analysis, + # integration-tests, + # test-jvm-packages, + # test-macos-packages, + # test-ios-packages, + # test-android-packages-emulator, + # # test-android-packages-device-farm, + # test-android-packages-device-farm-sync, + # package-all-artifacts + # ] + # if: | + # always() && + # !cancelled() && + # !endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && + # !contains(needs.*.result, 'failure') && + # !contains(needs.*.result, 'cancelled') && + # (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') && + # (needs.check-release-build.outputs.is_publish_build == 'true') + + # secrets: inherit + # with: + # version-label: ${{ needs.check-cache.outputs.version-label }} + # packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }} From 9d402528fcf2c667378b23866238b01bbc3021c8 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 22:25:53 +0200 Subject: [PATCH 20/74] Remove requirement --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5993289169..45402a6d4d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -28,12 +28,12 @@ jobs: # check-cache: # uses: ./.github/workflows/include-check-cache.yml - + # We build the same JNI SWIG stub once and re-use it across platforms to ensure any problems # with SWIG if we compile on each seperate platform. build-jni-swig-stub: runs-on: ubuntu-latest - needs: check-cache + # needs: check-cache if: always() && !cancelled() #&& needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - name: Checkout code From 6e05d69d83eb710788b3142274788a1d286729ca Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 22:50:51 +0200 Subject: [PATCH 21/74] Use cache on jni stubs --- .github/workflows/include-check-cache.yml | 592 +++++++++++----------- .github/workflows/pr.yml | 25 +- 2 files changed, 312 insertions(+), 305 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index cd3ac52174..2cfe5be396 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -20,32 +20,32 @@ on: outputs: version-label: value: ${{ jobs.check-cache.outputs.version-label }} - packages-metadata-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-metadata-cache-hit }} - packages-jvm-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-jvm-cache-hit }} - packages-android-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-android-cache-hit }} - android-test-base-apk-cache-hit: - value: ${{ jobs.check-cache.outputs.android-test-base-apk-cache-hit }} - android-test-sync-apk-cache-hit: - value: ${{ jobs.check-cache.outputs.android-test-sync-apk-cache-hit }} - packages-macos-x64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-macos-x64-cache-hit }} - packages-macos-arm64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-macos-arm64-cache-hit }} - packages-ios-x64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-ios-x64-cache-hit }} - packages-ios-arm64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-ios-arm64-cache-hit }} - jni-swig-stub-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-swig-stub-cache-hit }} - jni-linux-lib-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-linux-lib-cache-hit }} - jni-macos-lib-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-macos-lib-cache-hit }} - jni-windows-lib-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-windows-lib-cache-hit }} + # packages-metadata-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-metadata-cache-hit }} + # packages-jvm-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-jvm-cache-hit }} + # packages-android-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-android-cache-hit }} + # android-test-base-apk-cache-hit: + # value: ${{ jobs.check-cache.outputs.android-test-base-apk-cache-hit }} + # android-test-sync-apk-cache-hit: + # value: ${{ jobs.check-cache.outputs.android-test-sync-apk-cache-hit }} + # packages-macos-x64-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-macos-x64-cache-hit }} + # packages-macos-arm64-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-macos-arm64-cache-hit }} + # packages-ios-x64-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-ios-x64-cache-hit }} + # packages-ios-arm64-cache-hit: + # value: ${{ jobs.check-cache.outputs.packages-ios-arm64-cache-hit }} + # jni-swig-stub-cache-hit: + # value: ${{ jobs.check-cache.outputs.jni-swig-stub-cache-hit }} + # jni-linux-lib-cache-hit: + # value: ${{ jobs.check-cache.outputs.jni-linux-lib-cache-hit }} + # jni-macos-lib-cache-hit: + # value: ${{ jobs.check-cache.outputs.jni-macos-lib-cache-hit }} + # jni-windows-lib-cache-hit: + # value: ${{ jobs.check-cache.outputs.jni-windows-lib-cache-hit }} packages-sha: value: ${{ jobs.check-cache.outputs.packages-sha }} benchmarks-sha: @@ -59,19 +59,19 @@ jobs: name: Check cache outputs: version-label: ${{ steps.find-library-version.outputs.label }} - packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} - packages-jvm-cache-hit: ${{ steps.jvm-cache.outputs.cache-hit }} - packages-android-cache-hit: ${{ steps.android-cache.outputs.cache-hit }} - android-test-base-apk-cache-hit: ${{ steps.android-test-base-apk.outputs.cache-hit }} - android-test-sync-apk-cache-hit: ${{ steps.android-test-sync-apk.outputs.cache-hit }} - packages-macos-x64-cache-hit: ${{ steps.macos-x64-cache.outputs.cache-hit }} - packages-macos-arm64-cache-hit: ${{ steps.macos-arm64-cache.outputs.cache-hit }} - packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} - packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} - jni-swig-stub-cache-hit: ${{ steps.jni-swig-stub-cache.outputs.cache-hit }} - jni-linux-lib-cache-hit: ${{ steps.jni-linux-lib-cache.outputs.cache-hit }} - jni-macos-lib-cache-hit: ${{ steps.jni-macos-lib-cache.outputs.cache-hit }} - jni-windows-lib-cache-hit: ${{ steps.jni-windows-lib-cache.outputs.cache-hit }} + # packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} + # packages-jvm-cache-hit: ${{ steps.jvm-cache.outputs.cache-hit }} + # packages-android-cache-hit: ${{ steps.android-cache.outputs.cache-hit }} + # android-test-base-apk-cache-hit: ${{ steps.android-test-base-apk.outputs.cache-hit }} + # android-test-sync-apk-cache-hit: ${{ steps.android-test-sync-apk.outputs.cache-hit }} + # packages-macos-x64-cache-hit: ${{ steps.macos-x64-cache.outputs.cache-hit }} + # packages-macos-arm64-cache-hit: ${{ steps.macos-arm64-cache.outputs.cache-hit }} + # packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} + # packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} + # jni-swig-stub-cache-hit: ${{ steps.jni-swig-stub-cache.outputs.cache-hit }} + # jni-linux-lib-cache-hit: ${{ steps.jni-linux-lib-cache.outputs.cache-hit }} + # jni-macos-lib-cache-hit: ${{ steps.jni-macos-lib-cache.outputs.cache-hit }} + # jni-windows-lib-cache-hit: ${{ steps.jni-windows-lib-cache.outputs.cache-hit }} packages-sha: ${{ steps.packages-cache-key.outputs.sha }} benchmarks-sha: ${{ steps.calculate-benchmarks-cache-key.outputs.sha }} core-commit-sha: ${{ steps.calculate-core-commmit-sha.outputs.commit }} @@ -102,260 +102,260 @@ jobs: working-directory: packages/external/core run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - # - # For each specific package we need to perform 3 steps: - # - # 1. Check if a cache is available and download it if it is. - # 2. If (1), store this cache as an artifact for jobs downstream to use. - - # - # Kotlin Metadata and Gradle/Compiler Plugin - # - - name: Check Kotlin Metadata cache - id: kotlin-metadata-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save Kotlin Metadata packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' - with: - name: packages-metadata-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # JVM (All platforms) - # - - name: Check JVM cache - id: jvm-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save JVM packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' - with: - name: packages-jvm-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # JNI Stub (JVM) - # - - name: Check JNI Swig stub cache - id: jni-swig-stub-cache - uses: actions/cache@v4 - with: - path: ./packages/jni-swig-stub/build/generated/sources/jni - key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save JNI Stub packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' - with: - name: jni-stub-${{ steps.find-library-version.outputs.label }} - path: ./packages/jni-swig-stub/build/generated/sources/jni/* - retention-days: 1 - - # - # JNI MacOS Lib - # - - name: Check JNI MacOS lib cache - id: jni-macos-lib-cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmMacOsBuild - key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save JNI MacOS lib package - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' - with: - name: jni-macos-lib-${{ steps.find-library-version.outputs.label }} - path: ./packages/cinterop/build/realmMacOsBuild/**/* - retention-days: 1 - - # - # JNI Linux Lib - # - - name: Check JNI Linux lib cache - id: jni-linux-lib-cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmLinuxBuild - key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save JNI Linux lib package - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' - with: - name: jni-linux-lib-${{ steps.find-library-version.outputs.label }} - path: ./packages/cinterop/build/realmLinuxBuild/**/* - retention-days: 1 - - # - # Android - # - - name: Check Android cache - id: android-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save Android packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' - with: - name: packages-android-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # Android Base Test APK - # - - name: Check Android Base Test APK - id: android-test-base-apk - uses: actions/cache@v4 - with: - path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save Android Base Test APK - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' - with: - name: android-base-test-apk-${{ steps.find-library-version.outputs.label }} - path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - retention-days: 1 - - # - # Android Sync Test APK - # - - name: Check Android Sync Test APK - id: android-test-sync-apk - uses: actions/cache@v4 - with: - key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} - path: | - ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - lookup-only: true - - - name: Save Android Sync Test APK - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' - with: - name: android-sync-test-apk-${{ steps.find-library-version.outputs.label }} - retention-days: 1 - path: | - ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - # - # MacOS arm64 - # - - name: Check MacOS arm64 cache - id: macos-arm64-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save MacOS arm64 packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' - with: - name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # MacOS x64 - # - - name: Check MacOS X64 cache - id: macos-x64-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save MacOS x64 packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' - with: - name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # iOS arm64 - # - - name: Check iOS arm64 cache - id: ios-arm64-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save iOS arm64 packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' - with: - name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # iOS x64 - # - - name: Check iOS X64 cache - id: ios-x64-cache - uses: actions/cache@v4 - with: - path: ./packages/build/m2-buildrepo - key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - lookup-only: true - - - name: Save iOS x64 packages - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' - with: - name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} - path: ./packages/build/m2-buildrepo/**/* - retention-days: 1 - - # - # JNI Windows Lib - # - - name: Check JNI Windows lib cache - id: jni-windows-lib-cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmWindowsBuild - key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} - enableCrossOsArchive: true - lookup-only: true - - - name: Save JNI Windows lib package - uses: actions/upload-artifact@v4 - if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' - with: - name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} - path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll - retention-days: 1 + # # + # # For each specific package we need to perform 3 steps: + # # + # # 1. Check if a cache is available and download it if it is. + # # 2. If (1), store this cache as an artifact for jobs downstream to use. + + # # + # # Kotlin Metadata and Gradle/Compiler Plugin + # # + # - name: Check Kotlin Metadata cache + # id: kotlin-metadata-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save Kotlin Metadata packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' + # with: + # name: packages-metadata-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # JVM (All platforms) + # # + # - name: Check JVM cache + # id: jvm-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save JVM packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' + # with: + # name: packages-jvm-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # JNI Stub (JVM) + # # + # - name: Check JNI Swig stub cache + # id: jni-swig-stub-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/jni-swig-stub/build/generated/sources/jni + # key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save JNI Stub packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' + # with: + # name: jni-stub-${{ steps.find-library-version.outputs.label }} + # path: ./packages/jni-swig-stub/build/generated/sources/jni/* + # retention-days: 1 + + # # + # # JNI MacOS Lib + # # + # - name: Check JNI MacOS lib cache + # id: jni-macos-lib-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/cinterop/build/realmMacOsBuild + # key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save JNI MacOS lib package + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' + # with: + # name: jni-macos-lib-${{ steps.find-library-version.outputs.label }} + # path: ./packages/cinterop/build/realmMacOsBuild/**/* + # retention-days: 1 + + # # + # # JNI Linux Lib + # # + # - name: Check JNI Linux lib cache + # id: jni-linux-lib-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/cinterop/build/realmLinuxBuild + # key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save JNI Linux lib package + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' + # with: + # name: jni-linux-lib-${{ steps.find-library-version.outputs.label }} + # path: ./packages/cinterop/build/realmLinuxBuild/**/* + # retention-days: 1 + + # # + # # Android + # # + # - name: Check Android cache + # id: android-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save Android packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' + # with: + # name: packages-android-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # Android Base Test APK + # # + # - name: Check Android Base Test APK + # id: android-test-base-apk + # uses: actions/cache@v4 + # with: + # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + # key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save Android Base Test APK + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' + # with: + # name: android-base-test-apk-${{ steps.find-library-version.outputs.label }} + # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + # retention-days: 1 + + # # + # # Android Sync Test APK + # # + # - name: Check Android Sync Test APK + # id: android-test-sync-apk + # uses: actions/cache@v4 + # with: + # key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + # path: | + # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + # lookup-only: true + + # - name: Save Android Sync Test APK + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' + # with: + # name: android-sync-test-apk-${{ steps.find-library-version.outputs.label }} + # retention-days: 1 + # path: | + # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + # # + # # MacOS arm64 + # # + # - name: Check MacOS arm64 cache + # id: macos-arm64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save MacOS arm64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # MacOS x64 + # # + # - name: Check MacOS X64 cache + # id: macos-x64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save MacOS x64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # iOS arm64 + # # + # - name: Check iOS arm64 cache + # id: ios-arm64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save iOS arm64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # iOS x64 + # # + # - name: Check iOS X64 cache + # id: ios-x64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save iOS x64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # JNI Windows Lib + # # + # - name: Check JNI Windows lib cache + # id: jni-windows-lib-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/cinterop/build/realmWindowsBuild + # key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} + # enableCrossOsArchive: true + # lookup-only: true + + # - name: Save JNI Windows lib package + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' + # with: + # name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} + # path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll + # retention-days: 1 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 45402a6d4d..e9e557a227 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,22 +26,32 @@ jobs: static-analysis: uses: ./.github/workflows/include-static-analysis.yml - # check-cache: - # uses: ./.github/workflows/include-check-cache.yml + check-cache: + uses: ./.github/workflows/include-check-cache.yml # We build the same JNI SWIG stub once and re-use it across platforms to ensure any problems # with SWIG if we compile on each seperate platform. build-jni-swig-stub: runs-on: ubuntu-latest - # needs: check-cache + needs: check-cache if: always() && !cancelled() #&& needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: + - name: Check JNI Swig stub cache + id: jni-swig-stub-cache + uses: actions/cache@v4 + with: + path: ./packages/jni-swig-stub/build/generated/sources/jni + key: jni-swig-stubs-${{ needs.packages-cache-key.outputs.sha }} + - name: Checkout code uses: actions/checkout@v4 + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' with: submodules: "recursive" + - name: Setup Java 11 uses: actions/setup-java@v3 + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} @@ -51,14 +61,9 @@ jobs: with: cache-read-only: false - - name: Load build cache - uses: actions/cache@v4 - with: - path: ./packages/jni-swig-stub/build/generated/sources/jni - key: jni-swig-stubs-${{ needs.check-cache.outputs.packages-sha }} - - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -69,6 +74,7 @@ jobs: # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. - name: Install SWIG + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' run: | test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" @@ -81,6 +87,7 @@ jobs: - name: Build JNI Stub + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' working-directory: ./packages run: ./gradlew :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false From 6786245ebb52c919a5e0477a007d83bf85ac0c06 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 23:00:30 +0200 Subject: [PATCH 22/74] Update steps --- .github/workflows/pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e9e557a227..4b6c10455e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -58,6 +58,7 @@ jobs: - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' with: cache-read-only: false From 7fd79316f4066f957aa3eeb0113465a3da5530ff Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 23:07:48 +0200 Subject: [PATCH 23/74] testing output --- .github/workflows/pr.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4b6c10455e..a6c739c9fe 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,6 +36,10 @@ jobs: needs: check-cache if: always() && !cancelled() #&& needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: + - name: Testing + id: testing + run: | + echo "::set-output name=cache_hit::💚" - name: Check JNI Swig stub cache id: jni-swig-stub-cache uses: actions/cache@v4 @@ -86,7 +90,6 @@ jobs: cd ~ curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb - - name: Build JNI Stub if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' working-directory: ./packages From c50bc677583705d00a96498aad2f0ccf3ac57b9d Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 23:11:00 +0200 Subject: [PATCH 24/74] other test --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a6c739c9fe..c9899d784a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -39,7 +39,7 @@ jobs: - name: Testing id: testing run: | - echo "::set-output name=cache_hit::💚" + echo "### Hello world! :rocket:" >> $GITHUB_STEP_SUMMARY - name: Check JNI Swig stub cache id: jni-swig-stub-cache uses: actions/cache@v4 From b8bade2eb0eb6aa2ca4654414f20d5cea158e0ff Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 23:26:35 +0200 Subject: [PATCH 25/74] job status --- .github/workflows/pr.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c9899d784a..a85d55c927 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,23 +36,21 @@ jobs: needs: check-cache if: always() && !cancelled() #&& needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - - name: Testing - id: testing - run: | - echo "### Hello world! :rocket:" >> $GITHUB_STEP_SUMMARY - name: Check JNI Swig stub cache id: jni-swig-stub-cache uses: actions/cache@v4 with: path: ./packages/jni-swig-stub/build/generated/sources/jni key: jni-swig-stubs-${{ needs.packages-cache-key.outputs.sha }} - + - name: Testing + id: testing + run: | + echo "Job status: Hello world" - name: Checkout code uses: actions/checkout@v4 if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' with: submodules: "recursive" - - name: Setup Java 11 uses: actions/setup-java@v3 if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' From edfa0dc179dc7b50b18559fa0ada83dbc22126a6 Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 23:40:33 +0200 Subject: [PATCH 26/74] another step --- .github/workflows/pr.yml | 142 ++++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 68 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a85d55c927..4b4bb8acff 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,10 +34,10 @@ jobs: build-jni-swig-stub: runs-on: ubuntu-latest needs: check-cache - if: always() && !cancelled() #&& needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' + if: always() && !cancelled() steps: - - name: Check JNI Swig stub cache - id: jni-swig-stub-cache + - name: Artifact cache + id: artifact-cache uses: actions/cache@v4 with: path: ./packages/jni-swig-stub/build/generated/sources/jni @@ -48,25 +48,25 @@ jobs: echo "Job status: Hello world" - name: Checkout code uses: actions/checkout@v4 - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: submodules: "recursive" - name: Setup Java 11 uses: actions/setup-java@v3 - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: cache-read-only: false - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -77,7 +77,7 @@ jobs: # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. - name: Install SWIG - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' run: | test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" @@ -89,7 +89,7 @@ jobs: curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb - name: Build JNI Stub - if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit != 'true' + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' working-directory: ./packages run: ./gradlew :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false @@ -100,72 +100,78 @@ jobs: path: ./packages/jni-swig-stub/build/generated/sources/jni/* retention-days: 1 - # build-jvm-linux-native-lib: - # runs-on: ubuntu-latest - # needs: [check-cache, build-jni-swig-stub] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # needs.check-cache.outputs.jni-linux-lib-cache-hit != 'true' + build-jvm-linux-native-lib: + runs-on: ubuntu-latest + needs: [build-jni-swig-stub] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.check-cache.outputs.jni-linux-lib-cache-hit != 'true' - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" + steps: + - name: Artifact cache + id: artifact-cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmLinuxBuild + key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} - # - name: Setup build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/cinterop/build/realmLinuxBuild - # key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} + - name: Checkout code + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' + uses: actions/checkout@v4 + with: + submodules: "recursive" - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} + - name: Setup cmake + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} - # - name: Restore JNI Swig Stubs - # uses: actions/download-artifact@v3 - # with: - # name: jni-stub-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/jni-swig-stub/build/generated/sources/jni + - name: Restore JNI Swig Stubs + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' + uses: actions/download-artifact@v3 + with: + name: jni-stub-${{ needs.check-cache.outputs.version-label }} + path: ./packages/jni-swig-stub/build/generated/sources/jni - # - name: Build Docker image - # uses: docker/build-push-action@v3 - # with: - # tags: jvm-native-lib-linux:latest - # file: ./packages/cinterop/src/jvmMain/generic.Dockerfile - # push: false + - name: Build Docker image + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' + uses: docker/build-push-action@v3 + with: + tags: jvm-native-lib-linux:latest + file: ./packages/cinterop/src/jvmMain/generic.Dockerfile + push: false - # - name: Build native lib - # uses: addnab/docker-run-action@v3 - # with: - # image: jvm-native-lib-linux:latest - # shell: bash - # options: -v ${{ github.workspace }}:/work - # run: | - # cd /work/packages/cinterop - # mkdir build - # cd build - # rm -rf realmLinuxBuild - # mkdir realmLinuxBuild - # cd realmLinuxBuild - # cmake -DCMAKE_BUILD_TYPE=Release \ - # -DREALM_ENABLE_SYNC=1 \ - # -DREALM_NO_TESTS=1 \ - # -DREALM_BUILD_LIB_ONLY=true \ - # ../../src/jvm - # make -j8 + - name: Build native lib + if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' + uses: addnab/docker-run-action@v3 + with: + image: jvm-native-lib-linux:latest + shell: bash + options: -v ${{ github.workspace }}:/work + run: | + cd /work/packages/cinterop + mkdir build + cd build + rm -rf realmLinuxBuild + mkdir realmLinuxBuild + cd realmLinuxBuild + cmake -DCMAKE_BUILD_TYPE=Release \ + -DREALM_ENABLE_SYNC=1 \ + -DREALM_NO_TESTS=1 \ + -DREALM_BUILD_LIB_ONLY=true \ + ../../src/jvm + make -j8 - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/cinterop/build/realmLinuxBuild/librealmc.so - # retention-days: 1 + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} + path: ./packages/cinterop/build/realmLinuxBuild/librealmc.so + retention-days: 1 # build-jvm-windows-native-lib: # runs-on: windows-latest From a73076fa0c3033782a300138faff68f724d1f41a Mon Sep 17 00:00:00 2001 From: Clemente Date: Wed, 5 Jun 2024 23:42:29 +0200 Subject: [PATCH 27/74] add missing requirement --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4b4bb8acff..bc141a11ab 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -102,7 +102,7 @@ jobs: build-jvm-linux-native-lib: runs-on: ubuntu-latest - needs: [build-jni-swig-stub] + needs: [check-cache, build-jni-swig-stub] if: | always() && !cancelled() && From a2e207016e1a923ecdb4491d06b8a7740d5e1bfb Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 00:18:25 +0200 Subject: [PATCH 28/74] testing --- .github/workflows/include-check-cache.yml | 642 ++++++++++++---------- 1 file changed, 345 insertions(+), 297 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 2cfe5be396..256a56dff3 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -20,32 +20,32 @@ on: outputs: version-label: value: ${{ jobs.check-cache.outputs.version-label }} - # packages-metadata-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-metadata-cache-hit }} - # packages-jvm-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-jvm-cache-hit }} - # packages-android-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-android-cache-hit }} - # android-test-base-apk-cache-hit: - # value: ${{ jobs.check-cache.outputs.android-test-base-apk-cache-hit }} - # android-test-sync-apk-cache-hit: - # value: ${{ jobs.check-cache.outputs.android-test-sync-apk-cache-hit }} - # packages-macos-x64-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-macos-x64-cache-hit }} - # packages-macos-arm64-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-macos-arm64-cache-hit }} - # packages-ios-x64-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-ios-x64-cache-hit }} - # packages-ios-arm64-cache-hit: - # value: ${{ jobs.check-cache.outputs.packages-ios-arm64-cache-hit }} - # jni-swig-stub-cache-hit: - # value: ${{ jobs.check-cache.outputs.jni-swig-stub-cache-hit }} - # jni-linux-lib-cache-hit: - # value: ${{ jobs.check-cache.outputs.jni-linux-lib-cache-hit }} - # jni-macos-lib-cache-hit: - # value: ${{ jobs.check-cache.outputs.jni-macos-lib-cache-hit }} - # jni-windows-lib-cache-hit: - # value: ${{ jobs.check-cache.outputs.jni-windows-lib-cache-hit }} + packages-metadata-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-metadata-cache-hit }} + packages-jvm-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-jvm-cache-hit }} + packages-android-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-android-cache-hit }} + android-test-base-apk-cache-hit: + value: ${{ jobs.check-cache.outputs.android-test-base-apk-cache-hit }} + android-test-sync-apk-cache-hit: + value: ${{ jobs.check-cache.outputs.android-test-sync-apk-cache-hit }} + packages-macos-x64-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-macos-x64-cache-hit }} + packages-macos-arm64-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-macos-arm64-cache-hit }} + packages-ios-x64-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-ios-x64-cache-hit }} + packages-ios-arm64-cache-hit: + value: ${{ jobs.check-cache.outputs.packages-ios-arm64-cache-hit }} + jni-swig-stub-cache-hit: + value: ${{ jobs.check-cache.outputs.jni-swig-stub-cache-hit }} + jni-linux-lib-cache-hit: + value: ${{ jobs.check-cache.outputs.jni-linux-lib-cache-hit }} + jni-macos-lib-cache-hit: + value: ${{ jobs.check-cache.outputs.jni-macos-lib-cache-hit }} + jni-windows-lib-cache-hit: + value: ${{ jobs.check-cache.outputs.jni-windows-lib-cache-hit }} packages-sha: value: ${{ jobs.check-cache.outputs.packages-sha }} benchmarks-sha: @@ -54,24 +54,11 @@ on: value: ${{ jobs.check-cache.outputs.core-commit-sha }} jobs: - check-cache: + checksum: runs-on: ubuntu-latest name: Check cache outputs: version-label: ${{ steps.find-library-version.outputs.label }} - # packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} - # packages-jvm-cache-hit: ${{ steps.jvm-cache.outputs.cache-hit }} - # packages-android-cache-hit: ${{ steps.android-cache.outputs.cache-hit }} - # android-test-base-apk-cache-hit: ${{ steps.android-test-base-apk.outputs.cache-hit }} - # android-test-sync-apk-cache-hit: ${{ steps.android-test-sync-apk.outputs.cache-hit }} - # packages-macos-x64-cache-hit: ${{ steps.macos-x64-cache.outputs.cache-hit }} - # packages-macos-arm64-cache-hit: ${{ steps.macos-arm64-cache.outputs.cache-hit }} - # packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} - # packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} - # jni-swig-stub-cache-hit: ${{ steps.jni-swig-stub-cache.outputs.cache-hit }} - # jni-linux-lib-cache-hit: ${{ steps.jni-linux-lib-cache.outputs.cache-hit }} - # jni-macos-lib-cache-hit: ${{ steps.jni-macos-lib-cache.outputs.cache-hit }} - # jni-windows-lib-cache-hit: ${{ steps.jni-windows-lib-cache.outputs.cache-hit }} packages-sha: ${{ steps.packages-cache-key.outputs.sha }} benchmarks-sha: ${{ steps.calculate-benchmarks-cache-key.outputs.sha }} core-commit-sha: ${{ steps.calculate-core-commmit-sha.outputs.commit }} @@ -102,260 +89,321 @@ jobs: working-directory: packages/external/core run: echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - # # - # # For each specific package we need to perform 3 steps: - # # - # # 1. Check if a cache is available and download it if it is. - # # 2. If (1), store this cache as an artifact for jobs downstream to use. - - # # - # # Kotlin Metadata and Gradle/Compiler Plugin - # # - # - name: Check Kotlin Metadata cache - # id: kotlin-metadata-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save Kotlin Metadata packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' - # with: - # name: packages-metadata-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # JVM (All platforms) - # # - # - name: Check JVM cache - # id: jvm-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save JVM packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' - # with: - # name: packages-jvm-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # JNI Stub (JVM) - # # - # - name: Check JNI Swig stub cache - # id: jni-swig-stub-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/jni-swig-stub/build/generated/sources/jni - # key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save JNI Stub packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' - # with: - # name: jni-stub-${{ steps.find-library-version.outputs.label }} - # path: ./packages/jni-swig-stub/build/generated/sources/jni/* - # retention-days: 1 - - # # - # # JNI MacOS Lib - # # - # - name: Check JNI MacOS lib cache - # id: jni-macos-lib-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/cinterop/build/realmMacOsBuild - # key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save JNI MacOS lib package - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' - # with: - # name: jni-macos-lib-${{ steps.find-library-version.outputs.label }} - # path: ./packages/cinterop/build/realmMacOsBuild/**/* - # retention-days: 1 - - # # - # # JNI Linux Lib - # # - # - name: Check JNI Linux lib cache - # id: jni-linux-lib-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/cinterop/build/realmLinuxBuild - # key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save JNI Linux lib package - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' - # with: - # name: jni-linux-lib-${{ steps.find-library-version.outputs.label }} - # path: ./packages/cinterop/build/realmLinuxBuild/**/* - # retention-days: 1 - - # # - # # Android - # # - # - name: Check Android cache - # id: android-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save Android packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' - # with: - # name: packages-android-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # Android Base Test APK - # # - # - name: Check Android Base Test APK - # id: android-test-base-apk - # uses: actions/cache@v4 - # with: - # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - # key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save Android Base Test APK - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' - # with: - # name: android-base-test-apk-${{ steps.find-library-version.outputs.label }} - # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - # retention-days: 1 - - # # - # # Android Sync Test APK - # # - # - name: Check Android Sync Test APK - # id: android-test-sync-apk - # uses: actions/cache@v4 - # with: - # key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} - # path: | - # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - # lookup-only: true - - # - name: Save Android Sync Test APK - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' - # with: - # name: android-sync-test-apk-${{ steps.find-library-version.outputs.label }} - # retention-days: 1 - # path: | - # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - # # - # # MacOS arm64 - # # - # - name: Check MacOS arm64 cache - # id: macos-arm64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save MacOS arm64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # MacOS x64 - # # - # - name: Check MacOS X64 cache - # id: macos-x64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save MacOS x64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # iOS arm64 - # # - # - name: Check iOS arm64 cache - # id: ios-arm64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save iOS arm64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # iOS x64 - # # - # - name: Check iOS X64 cache - # id: ios-x64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save iOS x64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # JNI Windows Lib - # # - # - name: Check JNI Windows lib cache - # id: jni-windows-lib-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/cinterop/build/realmWindowsBuild - # key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} - # enableCrossOsArchive: true - # lookup-only: true - - # - name: Save JNI Windows lib package - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' - # with: - # name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} - # path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll - # retention-days: 1 + # + # Kotlin Metadata and Gradle/Compiler Plugin + # + metadata-compiler-plugin: + runs-on: ubuntu-latest + name: Metadata|Compiler + needs: checksum + outputs: + packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} + steps: + - name: Check Kotlin Metadata cache + id: kotlin-metadata-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} + - name: Save Kotlin Metadata packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' + with: + name: packages-metadata-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + # + # JVM (All platforms) + # + jvm-all: + runs-on: ubuntu-latest + needs: checksum + name: JVM All + outputs: + packages-jvm-cache-hit: ${{ steps.jvm-cache.outputs.cache-hit }} + + steps: + - name: Check JVM cache + id: jvm-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save JVM packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' + with: + name: packages-jvm-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + # + # JNI Stub (JVM) + # + jni-stub: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + jni-swig-stub-cache-hit: ${{ steps.jni-swig-stub-cache.outputs.cache-hit }} + + steps: + - name: Check JNI Swig stub cache + id: jni-swig-stub-cache + uses: actions/cache@v4 + with: + path: ./packages/jni-swig-stub/build/generated/sources/jni + key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save JNI Stub packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' + with: + name: jni-stub-${{ steps.find-library-version.outputs.label }} + path: ./packages/jni-swig-stub/build/generated/sources/jni/* + retention-days: 1 + + # + # JNI MacOS Lib + # + jni-macos-lib: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + jni-macos-lib-cache-hit: ${{ steps.jni-macos-lib-cache.outputs.cache-hit }} + + steps: + - name: Check JNI MacOS lib cache + id: jni-macos-lib-cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmMacOsBuild + key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} + - name: Save JNI MacOS lib package + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' + with: + name: jni-macos-lib-${{ steps.find-library-version.outputs.label }} + path: ./packages/cinterop/build/realmMacOsBuild/**/* + retention-days: 1 + + # + # JNI Linux Lib + # + jni-linux-lib: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + jni-linux-lib-cache-hit: ${{ steps.jni-linux-lib-cache.outputs.cache-hit }} + + steps: + - name: Check JNI Linux lib cache + id: jni-linux-lib-cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmLinuxBuild + key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save JNI Linux lib package + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' + with: + name: jni-linux-lib-${{ steps.find-library-version.outputs.label }} + path: ./packages/cinterop/build/realmLinuxBuild/**/* + retention-days: 1 + + # + # JNI Windows Lib + # + jni-windows-lib: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + jni-windows-lib-cache-hit: ${{ steps.jni-windows-lib-cache.outputs.cache-hit }} + steps: + - name: Check JNI Windows lib cache + id: jni-windows-lib-cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmWindowsBuild + key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} + enableCrossOsArchive: true + + - name: Save JNI Windows lib package + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' + with: + name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} + path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll + retention-days: 1 + # + # Android + # + android: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + packages-android-cache-hit: ${{ steps.android-cache.outputs.cache-hit }} + + steps: + - name: Check Android cache + id: android-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save Android packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' + with: + name: packages-android-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + # + # Android Base Test APK + # + android-test-base: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + android-test-base-apk-cache-hit: ${{ steps.android-test-base-apk.outputs.cache-hit }} + + steps: + - name: Check Android Base Test APK + id: android-test-base-apk + uses: actions/cache@v4 + with: + path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + - name: Save Android Base Test APK + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' + with: + name: android-base-test-apk-${{ steps.find-library-version.outputs.label }} + path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + retention-days: 1 + + # + # Android Sync Test APK + # + android-test-sync: + runs-on: ubuntu-latest + needs: checksum + name: Check cache + outputs: + android-test-sync-apk-cache-hit: ${{ steps.android-test-sync-apk.outputs.cache-hit }} + + steps: + - name: Check Android Sync Test APK + id: android-test-sync-apk + uses: actions/cache@v4 + with: + key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + path: | + ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + - name: Save Android Sync Test APK + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' + with: + name: android-sync-test-apk-${{ steps.find-library-version.outputs.label }} + retention-days: 1 + path: | + ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + # check-cache: + # runs-on: ubuntu-latest + # name: Check cache + # outputs: + # packages-macos-x64-cache-hit: ${{ steps.macos-x64-cache.outputs.cache-hit }} + # packages-macos-arm64-cache-hit: ${{ steps.macos-arm64-cache.outputs.cache-hit }} + # packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} + # packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} + + # steps: + # # + # # MacOS arm64 + # # + # - name: Check MacOS arm64 cache + # id: macos-arm64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save MacOS arm64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # MacOS x64 + # # + # - name: Check MacOS X64 cache + # id: macos-x64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save MacOS x64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # iOS arm64 + # # + # - name: Check iOS arm64 cache + # id: ios-arm64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save iOS arm64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 + + # # + # # iOS x64 + # # + # - name: Check iOS X64 cache + # id: ios-x64-cache + # uses: actions/cache@v4 + # with: + # path: ./packages/build/m2-buildrepo + # key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + # lookup-only: true + + # - name: Save iOS x64 packages + # uses: actions/upload-artifact@v4 + # if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' + # with: + # name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} + # path: ./packages/build/m2-buildrepo/**/* + # retention-days: 1 From ed90277092fb94051a9c83025ccbdd8bf5c8a321 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 00:24:07 +0200 Subject: [PATCH 29/74] Split cache jobs --- .github/workflows/include-check-cache.yml | 210 ++++++++++++---------- 1 file changed, 115 insertions(+), 95 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 256a56dff3..26be5febc7 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -56,7 +56,7 @@ on: jobs: checksum: runs-on: ubuntu-latest - name: Check cache + name: Cache SHA outputs: version-label: ${{ steps.find-library-version.outputs.label }} packages-sha: ${{ steps.packages-cache-key.outputs.sha }} @@ -94,7 +94,7 @@ jobs: # metadata-compiler-plugin: runs-on: ubuntu-latest - name: Metadata|Compiler + name: Metadata & Compiler plugin needs: checksum outputs: packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} @@ -119,7 +119,7 @@ jobs: jvm-all: runs-on: ubuntu-latest needs: checksum - name: JVM All + name: JVM (All platforms) outputs: packages-jvm-cache-hit: ${{ steps.jvm-cache.outputs.cache-hit }} @@ -145,7 +145,7 @@ jobs: jni-stub: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: JNI Stub (JVM) outputs: jni-swig-stub-cache-hit: ${{ steps.jni-swig-stub-cache.outputs.cache-hit }} @@ -171,7 +171,7 @@ jobs: jni-macos-lib: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: JNI MacOS Lib outputs: jni-macos-lib-cache-hit: ${{ steps.jni-macos-lib-cache.outputs.cache-hit }} @@ -196,7 +196,7 @@ jobs: jni-linux-lib: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: JNI Linux Lib outputs: jni-linux-lib-cache-hit: ${{ steps.jni-linux-lib-cache.outputs.cache-hit }} @@ -222,7 +222,7 @@ jobs: jni-windows-lib: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: JNI Windows Lib outputs: jni-windows-lib-cache-hit: ${{ steps.jni-windows-lib-cache.outputs.cache-hit }} steps: @@ -247,7 +247,7 @@ jobs: android: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: Android outputs: packages-android-cache-hit: ${{ steps.android-cache.outputs.cache-hit }} @@ -273,7 +273,7 @@ jobs: android-test-base: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: Android Base Test APK outputs: android-test-base-apk-cache-hit: ${{ steps.android-test-base-apk.outputs.cache-hit }} @@ -298,7 +298,7 @@ jobs: android-test-sync: runs-on: ubuntu-latest needs: checksum - name: Check cache + name: Android Sync Test APK outputs: android-test-sync-apk-cache-hit: ${{ steps.android-test-sync-apk.outputs.cache-hit }} @@ -322,88 +322,108 @@ jobs: ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - # check-cache: - # runs-on: ubuntu-latest - # name: Check cache - # outputs: - # packages-macos-x64-cache-hit: ${{ steps.macos-x64-cache.outputs.cache-hit }} - # packages-macos-arm64-cache-hit: ${{ steps.macos-arm64-cache.outputs.cache-hit }} - # packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} - # packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} - - # steps: - # # - # # MacOS arm64 - # # - # - name: Check MacOS arm64 cache - # id: macos-arm64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save MacOS arm64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # MacOS x64 - # # - # - name: Check MacOS X64 cache - # id: macos-x64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save MacOS x64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # iOS arm64 - # # - # - name: Check iOS arm64 cache - # id: ios-arm64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save iOS arm64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # # - # # iOS x64 - # # - # - name: Check iOS X64 cache - # id: ios-x64-cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} - # lookup-only: true - - # - name: Save iOS x64 packages - # uses: actions/upload-artifact@v4 - # if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' - # with: - # name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 + # + # MacOS arm64 + # + macos-arm: + runs-on: ubuntu-latest + needs: checksum + name: MacOS arm64 + outputs: + packages-macos-arm64-cache-hit: ${{ steps.macos-arm64-cache.outputs.cache-hit }} + + steps: + - name: Check MacOS arm64 cache + id: macos-arm64-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save MacOS arm64 packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' + with: + name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + # + # MacOS x64 + # + macos-x86: + runs-on: ubuntu-latest + needs: checksum + name: MacOS x64 + outputs: + packages-macos-x64-cache-hit: ${{ steps.macos-x64-cache.outputs.cache-hit }} + + steps: + - name: Check MacOS X64 cache + id: macos-x64-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save MacOS x64 packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' + with: + name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + + # + # iOS arm64 + # + ios-arm: + runs-on: ubuntu-latest + needs: checksum + name: iOS arm64 + outputs: + packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} + + steps: + - name: Check iOS arm64 cache + id: ios-arm64-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save iOS arm64 packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' + with: + name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + # + # iOS x64 + # + ios-x64: + runs-on: ubuntu-latest + needs: checksum + name: iOS x64 + outputs: + packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} + packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} + + steps: + - name: Check iOS X64 cache + id: ios-x64-cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + + - name: Save iOS x64 packages + uses: actions/upload-artifact@v4 + if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' + with: + name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 From 6997794d0ea211843aad0c91321237a71312129c Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 00:32:43 +0200 Subject: [PATCH 30/74] restore pr.yml --- .github/workflows/pr.yml | 3150 +++++++++++++++++++------------------- 1 file changed, 1566 insertions(+), 1584 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index bc141a11ab..09a61ff734 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -34,39 +34,32 @@ jobs: build-jni-swig-stub: runs-on: ubuntu-latest needs: check-cache - if: always() && !cancelled() + if: always() && !cancelled() && needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - - name: Artifact cache - id: artifact-cache - uses: actions/cache@v4 - with: - path: ./packages/jni-swig-stub/build/generated/sources/jni - key: jni-swig-stubs-${{ needs.packages-cache-key.outputs.sha }} - - name: Testing - id: testing - run: | - echo "Job status: Hello world" - name: Checkout code uses: actions/checkout@v4 - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: submodules: "recursive" + - name: Setup Java 11 uses: actions/setup-java@v3 - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/actions/setup-gradle@v3 - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' + uses: gradle/gradle-build-action@v2 with: cache-read-only: false + - name: Load build cache + uses: actions/cache@v4 + with: + path: ./packages/jni-swig-stub/build/generated/sources/jni + key: jni-swig-stubs-${{ needs.check-cache.outputs.packages-sha }} + - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -77,7 +70,6 @@ jobs: # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. - name: Install SWIG - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' run: | test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" @@ -88,8 +80,8 @@ jobs: cd ~ curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb + - name: Build JNI Stub - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' working-directory: ./packages run: ./gradlew :jni-swig-stub:assemble -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false @@ -111,34 +103,29 @@ jobs: needs.check-cache.outputs.jni-linux-lib-cache-hit != 'true' steps: - - name: Artifact cache - id: artifact-cache - uses: actions/cache@v4 - with: - path: ./packages/cinterop/build/realmLinuxBuild - key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} - - name: Checkout code - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' uses: actions/checkout@v4 with: submodules: "recursive" + - name: Setup build cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmLinuxBuild + key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} + - name: Setup cmake - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' uses: jwlawson/actions-setup-cmake@v1.13 with: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Restore JNI Swig Stubs - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' uses: actions/download-artifact@v3 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ./packages/jni-swig-stub/build/generated/sources/jni - name: Build Docker image - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' uses: docker/build-push-action@v3 with: tags: jvm-native-lib-linux:latest @@ -146,7 +133,6 @@ jobs: push: false - name: Build native lib - if: always() && !cancelled() && steps.artifact-cache.outputs.cache-hit != 'true' uses: addnab/docker-run-action@v3 with: image: jvm-native-lib-linux:latest @@ -173,1561 +159,1557 @@ jobs: path: ./packages/cinterop/build/realmLinuxBuild/librealmc.so retention-days: 1 - # build-jvm-windows-native-lib: - # runs-on: windows-latest - # needs: [check-cache, build-jni-swig-stub] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # needs.check-cache.outputs.jni-windows-lib-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # # TODO See https://github.com/microsoft/vcpkg/issues/25349 which might describe the error here https://github.com/realm/realm-kotlin/runs/8099890473?check_suite_focus=true - # # -- Building for: Visual Studio 17 2022 - # # -- Running vcpkg install - # # Error: while checking out port openssl with git tree 7e4d802e3bde4154c227c0dd1da75c719be9f07a - # # Error: Failed to tar port directory - # # error: tar failed with exit code: (128). - # # fatal: not a tree object: 7e4d802e3bde4154c227c0dd1da75c719be9f07a - # # TODO Implement better work-around here: https://mongodb.slack.com/archives/C017MBM0A30/p1661889411467029?thread_ts=1661888738.117769&cid=C017MBM0A30 - # fetch-depth: 0 - # submodules: "recursive" - - # - name: Setup build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/cinterop/build/realmWindowsBuild - # key: jni-windows-lib-${{ needs.check-cache.outputs.packages-sha }} - # enableCrossOsArchive: true - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Restore JNI Swig Stubs - # uses: actions/download-artifact@v3 - # with: - # name: jni-stub-${{ needs.check-cache.outputs.version-label }} - # path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni - - # - name: Build native lib - # shell: powershell - # working-directory: packages - # run: | - # cd cinterop - # mkdir build - # cd build - # Remove-Item -Path realmWindowsBuild -Force -Recurse -ErrorAction Ignore - # mkdir realmWindowsBuild - # cd realmWindowsBuild - # cmake ` - # ..\..\src\jvm ` - # -DCMAKE_GENERATOR_PLATFORM=x64 ` - # -DCMAKE_BUILD_TYPE=Release ` - # -DREALM_ENABLE_SYNC=ON ` - # -DREALM_NO_TESTS=1 ` - # -DVCPKG_TARGET_TRIPLET=x64-windows-static - # cmake --build . --config Release - - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll - # retention-days: 1 - - # build-jvm-macos-native-lib: - # runs-on: macos-12 - # needs: [check-cache, build-jni-swig-stub] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # needs.check-cache.outputs.jni-macos-lib-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'jvm-macos-native-lib' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # - name: Debug environment - # run: | - # env - # type cmake - # cmake --version - # type ninja - # ninja --version - - # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - # - name: Setup build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/cinterop/build/realmMacOsBuild - # key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} - - # - name: Restore JNI Swig Stubs - # uses: actions/download-artifact@v3 - # with: - # name: jni-stub-${{ needs.check-cache.outputs.version-label }} - # path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni - - # - name: Build packages - # working-directory: packages - # run: ./gradlew buildJVMSharedLibs -Prealm.kotlin.mainHost=false - - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/cinterop/build/realmMacOsBuild/librealmc.dylib - # retention-days: 1 - - # build-kotlin-metadata-package: - # runs-on: ubuntu-latest - # needs: [check-cache] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # needs.check-cache.outputs.packages-metadata-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'metadata-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # # This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? - # - name: Setup NDK - # uses: nttld/setup-ndk@v1 - # with: - # ndk-version: r23c - - # - name: Setup build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-metadata-${{ needs.check-cache.outputs.packages-sha }} + build-jvm-windows-native-lib: + runs-on: windows-latest + needs: [check-cache, build-jni-swig-stub] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.check-cache.outputs.jni-windows-lib-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # TODO See https://github.com/microsoft/vcpkg/issues/25349 which might describe the error here https://github.com/realm/realm-kotlin/runs/8099890473?check_suite_focus=true + # -- Building for: Visual Studio 17 2022 + # -- Running vcpkg install + # Error: while checking out port openssl with git tree 7e4d802e3bde4154c227c0dd1da75c719be9f07a + # Error: Failed to tar port directory + # error: tar failed with exit code: (128). + # fatal: not a tree object: 7e4d802e3bde4154c227c0dd1da75c719be9f07a + # TODO Implement better work-around here: https://mongodb.slack.com/archives/C017MBM0A30/p1661889411467029?thread_ts=1661888738.117769&cid=C017MBM0A30 + fetch-depth: 0 + submodules: "recursive" + + - name: Setup build cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmWindowsBuild + key: jni-windows-lib-${{ needs.check-cache.outputs.packages-sha }} + enableCrossOsArchive: true + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Restore JNI Swig Stubs + uses: actions/download-artifact@v3 + with: + name: jni-stub-${{ needs.check-cache.outputs.version-label }} + path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni + + - name: Build native lib + shell: powershell + working-directory: packages + run: | + cd cinterop + mkdir build + cd build + Remove-Item -Path realmWindowsBuild -Force -Recurse -ErrorAction Ignore + mkdir realmWindowsBuild + cd realmWindowsBuild + cmake ` + ..\..\src\jvm ` + -DCMAKE_GENERATOR_PLATFORM=x64 ` + -DCMAKE_BUILD_TYPE=Release ` + -DREALM_ENABLE_SYNC=ON ` + -DREALM_NO_TESTS=1 ` + -DVCPKG_TARGET_TRIPLET=x64-windows-static + cmake --build . --config Release + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} + path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll + retention-days: 1 + + build-jvm-macos-native-lib: + runs-on: macos-12 + needs: [check-cache, build-jni-swig-stub] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.check-cache.outputs.jni-macos-lib-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'jvm-macos-native-lib' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + - name: Debug environment + run: | + env + type cmake + cmake --version + type ninja + ninja --version + + # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + - name: Setup build cache + uses: actions/cache@v4 + with: + path: ./packages/cinterop/build/realmMacOsBuild + key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} + + - name: Restore JNI Swig Stubs + uses: actions/download-artifact@v3 + with: + name: jni-stub-${{ needs.check-cache.outputs.version-label }} + path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni + + - name: Build packages + working-directory: packages + run: ./gradlew buildJVMSharedLibs -Prealm.kotlin.mainHost=false + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} + path: ./packages/cinterop/build/realmMacOsBuild/librealmc.dylib + retention-days: 1 + + build-kotlin-metadata-package: + runs-on: ubuntu-latest + needs: [check-cache] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.check-cache.outputs.packages-metadata-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'metadata-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? + - name: Setup NDK + uses: nttld/setup-ndk@v1 + with: + ndk-version: r23c + + - name: Setup build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-metadata-${{ needs.check-cache.outputs.packages-sha }} - # - name: Build Kotlin Metadata and Gradle and Compiler Plugin - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true - - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - - # # This task is also responsible for creating the Gradle and Compiler Plugin as well as - # # all Kotlin Multiplatform Metadata - # build-jvm-packages: - # runs-on: macos-12 - # needs: [check-cache, build-jvm-linux-native-lib, build-jvm-windows-native-lib, build-jvm-macos-native-lib] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # needs.check-cache.outputs.packages-jvm-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'jvm-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? - # - name: Setup NDK - # uses: nttld/setup-ndk@v1 - # with: - # ndk-version: r23c - - # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - # - name: Setup build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} - - # - name: Restore Linux JNI lib - # uses: actions/download-artifact@v3 - # with: - # name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/cinterop/build/realmLinuxBuild - - # - name: Restore Windows JNI lib - # uses: actions/download-artifact@v3 - # with: - # name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/cinterop/build/realmWindowsBuild/Release - - # - name: Restore MacOS JNI lib - # uses: actions/download-artifact@v3 - # with: - # name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/cinterop/build/realmMacOsBuild + - name: Build Kotlin Metadata and Gradle and Compiler Plugin + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=gradlePlugin,compilerPlugin -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=true + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + + # This task is also responsible for creating the Gradle and Compiler Plugin as well as + # all Kotlin Multiplatform Metadata + build-jvm-packages: + runs-on: macos-12 + needs: [check-cache, build-jvm-linux-native-lib, build-jvm-windows-native-lib, build-jvm-macos-native-lib] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + needs.check-cache.outputs.packages-jvm-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'jvm-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? + - name: Setup NDK + uses: nttld/setup-ndk@v1 + with: + ndk-version: r23c + + # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + - name: Setup build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} + + - name: Restore Linux JNI lib + uses: actions/download-artifact@v3 + with: + name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} + path: ./packages/cinterop/build/realmLinuxBuild + + - name: Restore Windows JNI lib + uses: actions/download-artifact@v3 + with: + name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} + path: ./packages/cinterop/build/realmWindowsBuild/Release + + - name: Restore MacOS JNI lib + uses: actions/download-artifact@v3 + with: + name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} + path: ./packages/cinterop/build/realmMacOsBuild - # - name: Build JVM Package - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false - - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - - # build-android-packages: - # runs-on: ubuntu-latest - # needs: check-cache - # outputs: - # baas-container-id: ${{ steps.baas_cli_start.outputs.baas_container_id }} - # if: | - # always() && !cancelled() && - # (needs.check-cache.outputs.packages-android-cache-hit != 'true' || - # needs.check-cache.outputs.android-test-base-apk-cache-hit != 'true' || - # needs.check-cache.outputs.android-test-sync-apk-cache-hit != 'true') - - # steps: - # - name: Remove unnecessary files - # run: | - # sudo rm -rf /usr/share/dotnet - # sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Register problem matchers - # run: |- - # echo "::add-matcher::.github/problem-matchers/kotlin.json" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # # Manually install SWIG 4.1.1 as only 4.0.2 is pre-installed - # # 4.1.1 is not available in apt-get, so use brew instead - # # We need to use the formulae directly from GitHub to pin the version as Homebrew does not have - # # all versions available. - # # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts - # # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. - # - name: Install SWIG - # run: | - # test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" - # test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - # test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile - # echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile - # echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH - # echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH - # cd ~ - # curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb - - # - name: Install JSON parser - # run: brew install jq - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'android-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? - # - name: Setup NDK - # uses: nttld/setup-ndk@v1 - # with: - # ndk-version: r23c - - # - name: Build Android Base Test Apk - # working-directory: packages - # run: ./gradlew :test-base:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - - # - name: Build Android Sync Test Apk - # working-directory: packages - # run: ./gradlew :test-sync:packageDebug :test-sync:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - - # - name: Build packages - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false - - # - name: Store build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-android-sync-${{ needs.check-cache.outputs.packages-sha }} - - # - name: Store build cache for Android Test APK - # uses: actions/cache@v4 - # with: - # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - # key: android-base-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} - - # # Must match naming found in include-check-cache.yml - # - name: Store build cache for Android Sync Test APK - # uses: actions/cache@v4 - # with: - # key: android-sync-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} - # path: | - # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - # # Must match naming found in include-check-cache.yml - # # Must match naming found in include-check-cache.yml - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-android-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # - name: Upload Android Base Test APK - # uses: actions/upload-artifact@v4 - # with: - # name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - # retention-days: 1 - - # - name: Upload Android Sync Test APK - # uses: actions/upload-artifact@v4 - # with: - # name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} - # retention-days: 1 - # path: | - # ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - # ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - - - # # TODO: ccache is not being used by this build for some reason - # build-macos-x64-packages: - # runs-on: macos-12 - # needs: check-cache - # if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-x64-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'macos-x64-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # - name: Build packages - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false - - # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - # - name: Store build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-macos-x64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # # Must match naming found in include-check-cache.yml - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # build-macos-arm64-packages: - # runs-on: macos-12 - # needs: check-cache - # # needs: static-analysis - # if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-arm64-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'macos-arm64-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # - name: Build packages - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false - - # - name: Store build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-macos-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # # Must match naming found in include-check-cache.yml - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # build-ios-x64-packages: - # runs-on: macos-12 - # needs: check-cache - # # needs: static-analysis - # if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-x64-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'ios-x64-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # - name: Build packages - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosX64 -Prealm.kotlin.mainHost=false - - # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - # - name: Store build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-ios-x64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # # Must match naming found in include-check-cache.yml - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - # build-ios-arm64-packages: - # runs-on: macos-12 - # needs: check-cache - # # needs: static-analysis - # if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-arm64-cache-hit != 'true' - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Setup cmake - # uses: jwlawson/actions-setup-cmake@v1.13 - # with: - # cmake-version: ${{ vars.VERSION_CMAKE }} - - # - name: Setup ninja - # uses: cmelchior/setup-ninja@master - # with: - # version: ${{ vars.VERSION_NINJA }} - - # - name: Install ccache - # uses: hendrikmuhs/ccache-action@v1.2.2 - # with: - # key: 'ios-arm64-package' - # max-size: '2.0G' - - # - name: Prepend ccache executables to the PATH - # run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - - # # See https://github.com/hendrikmuhs/ccache-action/issues/94 - # - name: Configure ccache - # run: | - # ccache --set-config="compiler_check=content" - # ccache --show-config - # echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang - # echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ - - # - name: Build packages - # working-directory: packages - # run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosArm64 -Prealm.kotlin.mainHost=false - - # # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - # - name: Store build cache - # uses: actions/cache@v4 - # with: - # path: ./packages/build/m2-buildrepo - # key: packages-m2-ios-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} - - # # Must match naming found in include-check-cache.yml - # - name: Upload artifacts - # uses: actions/upload-artifact@v4 - # with: - # name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo/**/* - # retention-days: 1 - - - # # TODO Split into base and sync tests - # # TODO If we hook up to Device Farm we can use ubuntu runners instead - # # TODO Compare speed between emulator and Device Farm - # # TODO We should be able to move this into a reusable work-flow - - # # TODO Compare speed between emulator and Device Farm - # # TODO We should be able to move this into a reusable work-flow - # test-android-packages-emulator: - # timeout-minutes: 60 - # strategy: - # fail-fast: false - # matrix: - # type: [base, sync] - # include: - # - type: base - # test-title: Unit Test Results - Android Base (Emulator) - # - type: sync - # test-title: Unit Test Results - Android Sync (Emulator) - - # runs-on: macos-12 - # needs: [check-cache, build-android-packages, build-jvm-packages, build-kotlin-metadata-package] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # submodules: "recursive" - - # # checkout BAAS CLI repo - # - name: Checkout BAAS repo - # if: matrix.type == 'sync' - # run: | - # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - # gh repo clone 10gen/baasaas - - # # Start BAAS instance in the background - # # We save the container id to poll against and get the hostname info later - # - name: Start Baas instance in the background - # id: baas_cli_start - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # # curl: option --data: error encountered when reading a file - # OUTPUT=$(bash cli.sh start | jq -r '.id') - # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore m2-buildrepo (Android) - # uses: actions/download-artifact@v3 - # with: - # name: packages-android-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore m2-buildrepo (JVM) - # uses: actions/download-artifact@v3 - # with: - # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - # - name: Fetching the BAAS CLI hostname - # id: baas_cli_poll - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # # TODO This action does not support using `\` to split multiline scripts. - # - name: Run Integration Tests - # env: - # SSH_AUTH_SOCK: /tmp/ssh_agent.sock - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - # disable-animations: true - # api-level: ${{ vars.VERSION_ANDROID_EMULATOR_API_LEVEL }} # Must be 30 to support aosp_atd - # target: default - # arch: x86_64 - # disk-size: 4096M - # ram-size: 2048M - # heap-size: 1024M - # channel: canary - # script: | - # adb logcat -c - # adb logcat > logcat.txt & - # cd packages && ./gradlew :test-${{ matrix.type }}:connectedCheck -PsyncUsePlatformNetworking=true -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} -PincludeSdkModules=false --info --no-daemon - - # - name: Archive LogCat data - # uses: actions/upload-artifact@v4 - # if: always() || failure() - # with: - # name: logcat-${{ matrix.type }}-emulator.txt - # path: logcat.txt - # retention-days: 1 - - # - name: Publish Unit Test Results - # uses: dorny/test-reporter@v1 - # if: always() || failure() - # with: - # name: ${{ matrix.test-title }} - # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - # reporter: java-junit - # list-suites: failed - # list-tests: failed - # fail-on-error: true - - # - name: Stopping the BAAS container - # if: always() && matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - # fi - - # # Disable device farm test for Base, because running two in parallel seems to interfer somehow - # test-android-packages-device-farm: - # name: AWS Device Farm - # timeout-minutes: 60 - # runs-on: ubuntu-latest - # needs: [ check-cache, build-android-packages, build-jvm-packages ] - # if: | - # false && - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # - name: Restore Android Test APK - # uses: actions/download-artifact@v3 - # with: - # name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/test-base/build/outputs/apk/androidTest/debug - - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} - # aws-region: us-west-2 - - # - name: Run the tests - # uses: ./.github/actions/run-android-device-farm-test - # id: run_android_tests - # with: - # apk-path: ${{ github.workspace }}/packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - # app-id: io.realm.testapp - # project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} - # device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} - - - # test-android-packages-device-farm-sync: - # name: AWS Device Farm Sync Tests - # timeout-minutes: 60 - # runs-on: ubuntu-latest - # needs: [ check-cache, build-android-packages, build-jvm-packages ] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # # checkout BAAS CLI repo - # - name: Checkout BAAS repo - # run: | - # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - # gh repo clone 10gen/baasaas - - # # Start BAAS instance in the background - # # We save the container id to poll against and get the hostname info later - # - name: Start Baas instance in the background - # id: baas_cli_start - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # OUTPUT=$(bash cli.sh start | jq -r '.id') - # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Restore Android Sync Test APK - # uses: actions/download-artifact@v3 - # with: - # name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/test-sync/build/outputs/apk/ - - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v1 - # with: - # aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} - # aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} - # aws-region: us-west-2 - - # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - # - name: Fetching the BAAS CLI hostname - # id: baas_cli_poll - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Run the Sync tests - # uses: ./.github/actions/run-android-device-farm-test - # id: run_android_tests - # with: - # apk-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk - # apk-auxiliary-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk - # baas_url: ${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - # app-id: io.realm.sync.testapp.test - # project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} - # device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} - - # - name: Stopping the BAAS container - # if: always() - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - # fi - - # test-macos-packages: - # timeout-minutes: 60 - # strategy: - # fail-fast: false - # matrix: - # os: [macos-12] # , macos-arm] - # type: [base, sync] - # include: - # - os: macos-12 - # type: base - # os-id: macos - # package-prefix: macos-x64 - # test-title: Unit Test Results - MacOS x64 Base - # - os: macos-12 - # type: sync - # os-id: macos - # package-prefix: macos-x64 - # test-title: Unit Test Results - MacOS x64 Sync - # # - os: macos-arm - # # package-prefix: macos-arm64 - # # test-title: Results - MacOS arm64 Base - - # runs-on: ${{ matrix.os }} - # # TODO Unclear why MacOS needs the metadata package when the Android Tests do not - # # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. - # needs: [check-cache, build-macos-x64-packages, build-kotlin-metadata-package] #, build-macos-arm64-packages] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # # checkout BAAS CLI repo - # - name: Checkout BAAS repo - # if: matrix.type == 'sync' - # run: | - # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - # gh repo clone 10gen/baasaas - - # # Start BAAS instance in the background - # # We save the container id to poll against and get the hostname info later - # - name: Start Baas instance in the background - # id: baas_cli_start - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # # curl: option --data: error encountered when reading a file - # OUTPUT=$(bash cli.sh start | jq -r '.id') - # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Restore m2-buildrepo - # uses: actions/download-artifact@v3 - # with: - # name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - - # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - # - name: Fetching the BAAS CLI hostname - # id: baas_cli_poll - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Run tests - # working-directory: packages - # run: > - # ./gradlew :test-${{ matrix.type }}:macosTest - # -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - # -PincludeSdkModules=false - # --info --no-daemon - - # - name: Publish Unit Test Results - # uses: dorny/test-reporter@v1 - # if: always() || failure() - # with: - # name: ${{ matrix.test-title }} - # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - # reporter: java-junit - # list-suites: failed - # list-tests: failed - # fail-on-error: true - - # - name: Stopping the BAAS container - # if: always() && matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - # fi - - - # test-ios-packages: - # timeout-minutes: 60 - # strategy: - # fail-fast: false - # matrix: - # os: [macos-12] # , macos-arm] - # type: [base, sync] - # include: - # - os: macos-12 - # type: base - # package-prefix: x64 - # test-title: Unit Test Results - iOS x64 Base - # test-task: iosTest - # - os: macos-12 - # type: sync - # package-prefix: x64 - # test-title: Unit Test Results - iOS x64 Sync - # test-task: iosTest - # # - os: macos-arm - # # package-prefix: macos-arm64 - # # test-title: Results - MacOS arm64 Base + - name: Build JVM Package + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + + build-android-packages: + runs-on: ubuntu-latest + needs: check-cache + outputs: + baas-container-id: ${{ steps.baas_cli_start.outputs.baas_container_id }} + if: | + always() && !cancelled() && + (needs.check-cache.outputs.packages-android-cache-hit != 'true' || + needs.check-cache.outputs.android-test-base-apk-cache-hit != 'true' || + needs.check-cache.outputs.android-test-sync-apk-cache-hit != 'true') + + steps: + - name: Remove unnecessary files + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + # Manually install SWIG 4.1.1 as only 4.0.2 is pre-installed + # 4.1.1 is not available in apt-get, so use brew instead + # We need to use the formulae directly from GitHub to pin the version as Homebrew does not have + # all versions available. + # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#ubuntu-22041-lts + # It seems to be required to manually add brew dirs to the PATH. This does not happen automatically. + - name: Install SWIG + run: | + test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" + test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile + echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile + echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + cd ~ + curl -L ${{ vars.VERSION_SWIG}} > swig.rb && HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=true brew install swig.rb + + - name: Install JSON parser + run: brew install jq + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} - # runs-on: ${{ matrix.os }} - # # TODO Unclear why MacOS needs the metadata package when the Android Tests do not - # # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. - # needs: [check-cache, build-ios-x64-packages, build-kotlin-metadata-package] # , build-ios-arm64-packages] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # # checkout BAAS CLI repo - # - name: Checkout BAAS repo - # if: matrix.type == 'sync' - # run: | - # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - # gh repo clone 10gen/baasaas - - # # Start BAAS instance in the background - # # We save the container id to poll against and get the hostname info later - # - name: Start Baas instance in the background - # id: baas_cli_start - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # # curl: option --data: error encountered when reading a file - # OUTPUT=$(bash cli.sh start | jq -r '.id') - # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Restore m2-buildrepo (ios) - # uses: actions/download-artifact@v3 - # with: - # name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - - # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - # - name: Fetching the BAAS CLI hostname - # id: baas_cli_poll - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. - # - name: Run tests - # working-directory: packages - # run: > - # ./gradlew :test-${{ matrix.type }}:${{ matrix.test-task }} - # -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - # -PincludeSdkModules=false - # --info --no-daemon - - # - name: Publish Unit Test Results - # uses: dorny/test-reporter@v1 - # if: always() || failure() - # with: - # name: ${{ matrix.test-title }} - # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - # reporter: java-junit - # list-suites: failed - # list-tests: failed - # fail-on-error: true - - # - name: Stopping the BAAS container - # if: always() && matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - # fi - - # test-jvm-packages: - # timeout-minutes: 60 - # strategy: - # fail-fast: false - # matrix: - # os: [macos-12, ubuntu-latest, windows-latest] # TODO Should we also test om MacOS arm64? - # type: [base, sync] - # include: - # - os: macos-12 - # os-id: mac - # type: base - # test-title: Unit Test Results - Base JVM MacOS x64 - # - os: ubuntu-latest - # os-id: ubu - # type: base - # test-title: Unit Test Results - Base JVM Linux - # - os: windows-latest - # os-id: win - # type: base - # test-title: Unit Test Results - Base JVM Windows - # - os: macos-12 - # os-id: mac - # type: sync - # test-title: Unit Test Results - Sync JVM MacOS x64 - # - os: ubuntu-latest - # os-id: ubu - # type: sync - # test-title: Unit Test Results - Sync JVM Linux - # exclude: - # # Do not run Windows Sync Tests, because the bash script for - # # starting the BAAS container doesn not work on Windows. - # - os: windows-latest - # #os-id: win - # type: sync - # #test-title: Unit Test Results - Sync JVM Windows - - # runs-on: ${{ matrix.os }} - # needs: [check-cache, build-jvm-packages, build-kotlin-metadata-package] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # # checkout BAAS CLI repo - # - name: Checkout BAAS repo - # if: matrix.type == 'sync' - # run: | - # echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token - # gh repo clone 10gen/baasaas - - # # Start BAAS instance in the background - # # We save the container id to poll against and get the hostname info later - # - name: Start Baas instance in the background - # id: baas_cli_start - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner - # # curl: option --data: error encountered when reading a file - # OUTPUT=$(bash cli.sh start | jq -r '.id') - # echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - - # - name: Setup Java 11 - # uses: actions/setup-java@v3 - # with: - # distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} - # java-version: ${{ vars.VERSION_JAVA }} - - # - name: Setup Gradle and task/dependency caching - # uses: gradle/gradle/actions/setup-gradle@v3 - # with: - # cache-read-only: false - - # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore m2-buildrepo - # uses: actions/download-artifact@v3 - # with: - # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests - # - name: Fetching the BAAS CLI hostname - # id: baas_cli_poll - # if: matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') - # echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT - - # # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. - # - name: Run tests - # working-directory: packages - # run: > - # ./gradlew :test-${{ matrix.type }}:jvmTest - # -PsyncUsePlatformNetworking=true - # -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} - # -PincludeSdkModules=false - # --info --no-daemon - - # - name: Publish Unit Test Results - # uses: dorny/test-reporter@v1 - # if: always() || failure() - # with: - # name: ${{ matrix.test-title }} - # path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml - # reporter: java-junit - # list-suites: failed - # list-tests: failed - # fail-on-error: true - - # - name: Stopping the BAAS container - # if: always() && matrix.type == 'sync' - # working-directory: baasaas - # env: - # APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} - # run: | - # if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then - # bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} - # fi - - # package-all-artifacts: - # runs-on: ubuntu-latest - # needs: [check-cache, build-jvm-packages, build-android-packages, build-macos-x64-packages, build-macos-arm64-packages, build-ios-x64-packages, build-ios-arm64-packages, build-kotlin-metadata-package] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # # The Metadata artifact contain broken JVM publications, so it needs to be - # # restored first, it so they can be overidden with the correct ones. - # - name: Restore Kotlin metadata artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-metadata-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore Android artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-android-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore JVM artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-jvm-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore MacOS x64 artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore MacOS arm64 artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore iOS x64 artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Restore iOS arm64 artifacts - # uses: actions/download-artifact@v3 - # with: - # name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - - # - name: Upload artifacts bundle - # uses: actions/upload-artifact@v4 - # with: - # name: all-packages-${{ needs.check-cache.outputs.version-label }} - # path: ./packages/build/m2-buildrepo - # retention-days: 7 - - # integration-tests: - # uses: ./.github/workflows/include-integration-tests.yml - # needs: [check-cache, package-all-artifacts] - # if: | - # always() && - # !cancelled() && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') - # with: - # version-label: ${{ needs.check-cache.outputs.version-label }} - - # deploy-snapshot: - # uses: ./.github/workflows/include-deploy-snapshot.yml - # needs: [ - # check-cache, - # static-analysis, - # integration-tests, - # test-jvm-packages, - # test-macos-packages, - # test-ios-packages, - # test-android-packages-emulator, - # # test-android-packages-device-farm, - # test-android-packages-device-farm-sync, - # package-all-artifacts - # ] - # if: | - # always() && - # !cancelled() && - # endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') - - # secrets: inherit - # with: - # version-label: ${{ needs.check-cache.outputs.version-label }} - - # # This job sets an output `is_publish_build` to `true` if this is a release build - # check-release-build: - # runs-on: ubuntu-latest - # needs: [check-cache] - # outputs: - # is_publish_build: ${{ steps.check_release.outputs.is_publish_build }} - - # steps: - # - uses: actions/checkout@v4 - - # - name: Check if release build - # id: check_release - # run: | - # git fetch --tags - # gitTag=$(git describe --tags --exact-match HEAD) || echo "NONE" - # echo "Git branch/tag: ${GITHUB_REF}/${gitTag:-'none'}" - - # if [[ -z "$gitTag" ]]; then - # gitSha=$(git rev-parse HEAD | cut -c1-8) - # echo "Building commit: ${{ needs.check-cache.outputs.version-label }} - ${gitSha}" - # echo "is_publish_build=false" >> $GITHUB_OUTPUT - # else - # if [[ "$gitTag" != "v${{ needs.check-cache.outputs.version-label }}" ]]; then - # echo "Git tag '${gitTag}' does not match v${{ needs.check-cache.outputs.version-label }}" - # echo "is_publish_build=false" >> $GITHUB_OUTPUT - # else - # echo "Building release: '${gitTag}'" - # echo "is_publish_build=true" >> $GITHUB_OUTPUT - # fi - # fi - + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'android-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + # TODO This matches 23.2.8568313, but what happens if we a define specific ndk version in our build? + - name: Setup NDK + uses: nttld/setup-ndk@v1 + with: + ndk-version: r23c + + - name: Build Android Base Test Apk + working-directory: packages + run: ./gradlew :test-base:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false + + - name: Build Android Sync Test Apk + working-directory: packages + run: ./gradlew :test-sync:packageDebug :test-sync:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false + + - name: Build packages + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=android -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false + + - name: Store build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-android-sync-${{ needs.check-cache.outputs.packages-sha }} + + - name: Store build cache for Android Test APK + uses: actions/cache@v4 + with: + path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + key: android-base-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} + + # Must match naming found in include-check-cache.yml + - name: Store build cache for Android Sync Test APK + uses: actions/cache@v4 + with: + key: android-sync-test-apk-key-${{ needs.check-cache.outputs.packages-sha }} + path: | + ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + # Must match naming found in include-check-cache.yml + # Must match naming found in include-check-cache.yml + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-android-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + - name: Upload Android Base Test APK + uses: actions/upload-artifact@v4 + with: + name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} + path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + retention-days: 1 + + - name: Upload Android Sync Test APK + uses: actions/upload-artifact@v4 + with: + name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} + retention-days: 1 + path: | + ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + + + # TODO: ccache is not being used by this build for some reason + build-macos-x64-packages: + runs-on: macos-12 + needs: check-cache + if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-x64-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'macos-x64-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + - name: Build packages + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false + + # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + - name: Store build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-macos-x64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # Must match naming found in include-check-cache.yml + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + build-macos-arm64-packages: + runs-on: macos-12 + needs: check-cache + # needs: static-analysis + if: always() && !cancelled() && needs.check-cache.outputs.packages-macos-arm64-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'macos-arm64-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + - name: Build packages + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosArm64 -Prealm.kotlin.mainHost=false + + - name: Store build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-macos-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # Must match naming found in include-check-cache.yml + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + build-ios-x64-packages: + runs-on: macos-12 + needs: check-cache + # needs: static-analysis + if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-x64-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'ios-x64-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + - name: Build packages + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosX64 -Prealm.kotlin.mainHost=false + + # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + - name: Store build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-ios-x64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # Must match naming found in include-check-cache.yml + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + build-ios-arm64-packages: + runs-on: macos-12 + needs: check-cache + # needs: static-analysis + if: always() && !cancelled() && needs.check-cache.outputs.packages-ios-arm64-cache-hit != 'true' + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: ${{ vars.VERSION_CMAKE }} + + - name: Setup ninja + uses: cmelchior/setup-ninja@master + with: + version: ${{ vars.VERSION_NINJA }} + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2.2 + with: + key: 'ios-arm64-package' + max-size: '2.0G' + + - name: Prepend ccache executables to the PATH + run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH + + # See https://github.com/hendrikmuhs/ccache-action/issues/94 + - name: Configure ccache + run: | + ccache --set-config="compiler_check=content" + ccache --show-config + echo '#!/bin/bash\nccache clang "$@"%"' > /usr/local/bin/ccache-clang + echo '#!/bin/bash\nccache clang++ "$@"%"' > /usr/local/bin/ccache-clang++ + + - name: Build packages + working-directory: packages + run: ./gradlew publishCIPackages -Prealm.kotlin.targets=iosArm64 -Prealm.kotlin.mainHost=false + + # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. + - name: Store build cache + uses: actions/cache@v4 + with: + path: ./packages/build/m2-buildrepo + key: packages-m2-ios-arm64-sync-${{ needs.check-cache.outputs.packages-sha }} + + # Must match naming found in include-check-cache.yml + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo/**/* + retention-days: 1 + + + # TODO Split into base and sync tests + # TODO If we hook up to Device Farm we can use ubuntu runners instead + # TODO Compare speed between emulator and Device Farm + # TODO We should be able to move this into a reusable work-flow + + # TODO Compare speed between emulator and Device Farm + # TODO We should be able to move this into a reusable work-flow + test-android-packages-emulator: + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + type: [base, sync] + include: + - type: base + test-title: Unit Test Results - Android Base (Emulator) + - type: sync + test-title: Unit Test Results - Android Sync (Emulator) + + runs-on: macos-12 + needs: [check-cache, build-android-packages, build-jvm-packages, build-kotlin-metadata-package] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: "recursive" + + # checkout BAAS CLI repo + - name: Checkout BAAS repo + if: matrix.type == 'sync' + run: | + echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + gh repo clone 10gen/baasaas + + # Start BAAS instance in the background + # We save the container id to poll against and get the hostname info later + - name: Start Baas instance in the background + id: baas_cli_start + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # curl: option --data: error encountered when reading a file + OUTPUT=$(bash cli.sh start | jq -r '.id') + echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Restore Kotlin metadata artifacts + uses: actions/download-artifact@v3 + with: + name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore m2-buildrepo (Android) + uses: actions/download-artifact@v3 + with: + name: packages-android-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore m2-buildrepo (JVM) + uses: actions/download-artifact@v3 + with: + name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + - name: Fetching the BAAS CLI hostname + id: baas_cli_poll + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # TODO This action does not support using `\` to split multiline scripts. + - name: Run Integration Tests + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.sock + uses: reactivecircus/android-emulator-runner@v2 + with: + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + api-level: ${{ vars.VERSION_ANDROID_EMULATOR_API_LEVEL }} # Must be 30 to support aosp_atd + target: default + arch: x86_64 + disk-size: 4096M + ram-size: 2048M + heap-size: 1024M + channel: canary + script: | + adb logcat -c + adb logcat > logcat.txt & + cd packages && ./gradlew :test-${{ matrix.type }}:connectedCheck -PsyncUsePlatformNetworking=true -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} -PincludeSdkModules=false --info --no-daemon + + - name: Archive LogCat data + uses: actions/upload-artifact@v4 + if: always() || failure() + with: + name: logcat-${{ matrix.type }}-emulator.txt + path: logcat.txt + retention-days: 1 + + - name: Publish Unit Test Results + uses: dorny/test-reporter@v1 + if: always() || failure() + with: + name: ${{ matrix.test-title }} + path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + reporter: java-junit + list-suites: failed + list-tests: failed + fail-on-error: true + + - name: Stopping the BAAS container + if: always() && matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + fi + + # Disable device farm test for Base, because running two in parallel seems to interfer somehow + test-android-packages-device-farm: + name: AWS Device Farm + timeout-minutes: 60 + runs-on: ubuntu-latest + needs: [ check-cache, build-android-packages, build-jvm-packages ] + if: | + false && + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Restore Android Test APK + uses: actions/download-artifact@v3 + with: + name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} + path: ./packages/test-base/build/outputs/apk/androidTest/debug + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Run the tests + uses: ./.github/actions/run-android-device-farm-test + id: run_android_tests + with: + apk-path: ${{ github.workspace }}/packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk + app-id: io.realm.testapp + project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} + device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} + + + test-android-packages-device-farm-sync: + name: AWS Device Farm Sync Tests + timeout-minutes: 60 + runs-on: ubuntu-latest + needs: [ check-cache, build-android-packages, build-jvm-packages ] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # checkout BAAS CLI repo + - name: Checkout BAAS repo + run: | + echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + gh repo clone 10gen/baasaas + + # Start BAAS instance in the background + # We save the container id to poll against and get the hostname info later + - name: Start Baas instance in the background + id: baas_cli_start + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + OUTPUT=$(bash cli.sh start | jq -r '.id') + echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Restore Android Sync Test APK + uses: actions/download-artifact@v3 + with: + name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} + path: ./packages/test-sync/build/outputs/apk/ + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + - name: Fetching the BAAS CLI hostname + id: baas_cli_poll + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Run the Sync tests + uses: ./.github/actions/run-android-device-farm-test + id: run_android_tests + with: + apk-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk + apk-auxiliary-path: ${{ github.workspace }}/packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk + baas_url: ${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + app-id: io.realm.sync.testapp.test + project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }} + device-pool-arn: ${{ secrets.DEVICEFARM_POOL_ARN }} + + - name: Stopping the BAAS container + if: always() + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + fi + + test-macos-packages: + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + os: [macos-12] # , macos-arm] + type: [base, sync] + include: + - os: macos-12 + type: base + os-id: macos + package-prefix: macos-x64 + test-title: Unit Test Results - MacOS x64 Base + - os: macos-12 + type: sync + os-id: macos + package-prefix: macos-x64 + test-title: Unit Test Results - MacOS x64 Sync + # - os: macos-arm + # package-prefix: macos-arm64 + # test-title: Results - MacOS arm64 Base + + runs-on: ${{ matrix.os }} + # TODO Unclear why MacOS needs the metadata package when the Android Tests do not + # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. + needs: [check-cache, build-macos-x64-packages, build-kotlin-metadata-package] #, build-macos-arm64-packages] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # checkout BAAS CLI repo + - name: Checkout BAAS repo + if: matrix.type == 'sync' + run: | + echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + gh repo clone 10gen/baasaas + + # Start BAAS instance in the background + # We save the container id to poll against and get the hostname info later + - name: Start Baas instance in the background + id: baas_cli_start + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # curl: option --data: error encountered when reading a file + OUTPUT=$(bash cli.sh start | jq -r '.id') + echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Restore m2-buildrepo + uses: actions/download-artifact@v3 + with: + name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore Kotlin metadata artifacts + uses: actions/download-artifact@v3 + with: + name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + + # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + - name: Fetching the BAAS CLI hostname + id: baas_cli_poll + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Run tests + working-directory: packages + run: > + ./gradlew :test-${{ matrix.type }}:macosTest + -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + -PincludeSdkModules=false + --info --no-daemon + + - name: Publish Unit Test Results + uses: dorny/test-reporter@v1 + if: always() || failure() + with: + name: ${{ matrix.test-title }} + path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + reporter: java-junit + list-suites: failed + list-tests: failed + fail-on-error: true + + - name: Stopping the BAAS container + if: always() && matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + fi + + + test-ios-packages: + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + os: [macos-12] # , macos-arm] + type: [base, sync] + include: + - os: macos-12 + type: base + package-prefix: x64 + test-title: Unit Test Results - iOS x64 Base + test-task: iosTest + - os: macos-12 + type: sync + package-prefix: x64 + test-title: Unit Test Results - iOS x64 Sync + test-task: iosTest + # - os: macos-arm + # package-prefix: macos-arm64 + # test-title: Results - MacOS arm64 Base + + runs-on: ${{ matrix.os }} + # TODO Unclear why MacOS needs the metadata package when the Android Tests do not + # Disable macos-arm for now as the host needs to have the Android SDK installed even though it isn't really using it. + needs: [check-cache, build-ios-x64-packages, build-kotlin-metadata-package] # , build-ios-arm64-packages] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # checkout BAAS CLI repo + - name: Checkout BAAS repo + if: matrix.type == 'sync' + run: | + echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + gh repo clone 10gen/baasaas + + # Start BAAS instance in the background + # We save the container id to poll against and get the hostname info later + - name: Start Baas instance in the background + id: baas_cli_start + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # curl: option --data: error encountered when reading a file + OUTPUT=$(bash cli.sh start | jq -r '.id') + echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Restore m2-buildrepo (ios) + uses: actions/download-artifact@v3 + with: + name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore Kotlin metadata artifacts + uses: actions/download-artifact@v3 + with: + name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + + # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + - name: Fetching the BAAS CLI hostname + id: baas_cli_poll + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. + - name: Run tests + working-directory: packages + run: > + ./gradlew :test-${{ matrix.type }}:${{ matrix.test-task }} + -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + -PincludeSdkModules=false + --info --no-daemon + + - name: Publish Unit Test Results + uses: dorny/test-reporter@v1 + if: always() || failure() + with: + name: ${{ matrix.test-title }} + path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + reporter: java-junit + list-suites: failed + list-tests: failed + fail-on-error: true + + - name: Stopping the BAAS container + if: always() && matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + fi + + test-jvm-packages: + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + os: [macos-12, ubuntu-latest, windows-latest] # TODO Should we also test om MacOS arm64? + type: [base, sync] + include: + - os: macos-12 + os-id: mac + type: base + test-title: Unit Test Results - Base JVM MacOS x64 + - os: ubuntu-latest + os-id: ubu + type: base + test-title: Unit Test Results - Base JVM Linux + - os: windows-latest + os-id: win + type: base + test-title: Unit Test Results - Base JVM Windows + - os: macos-12 + os-id: mac + type: sync + test-title: Unit Test Results - Sync JVM MacOS x64 + - os: ubuntu-latest + os-id: ubu + type: sync + test-title: Unit Test Results - Sync JVM Linux + exclude: + # Do not run Windows Sync Tests, because the bash script for + # starting the BAAS container doesn not work on Windows. + - os: windows-latest + #os-id: win + type: sync + #test-title: Unit Test Results - Sync JVM Windows + + runs-on: ${{ matrix.os }} + needs: [check-cache, build-jvm-packages, build-kotlin-metadata-package] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # checkout BAAS CLI repo + - name: Checkout BAAS repo + if: matrix.type == 'sync' + run: | + echo ${{ secrets.BAAS_CLI }} | gh auth login --with-token + gh repo clone 10gen/baasaas + + # Start BAAS instance in the background + # We save the container id to poll against and get the hostname info later + - name: Start Baas instance in the background + id: baas_cli_start + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + # Adding a dummy tag (foo=bar) to avoid the following issue on macos-runner + # curl: option --data: error encountered when reading a file + OUTPUT=$(bash cli.sh start | jq -r '.id') + echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} + java-version: ${{ vars.VERSION_JAVA }} + + - name: Setup Gradle and task/dependency caching + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + + - name: Restore Kotlin metadata artifacts + uses: actions/download-artifact@v3 + with: + name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore m2-buildrepo + uses: actions/download-artifact@v3 + with: + name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + # We poll the previously started BAAS container to get the hostname of the container to use with Device Farm tests + - name: Fetching the BAAS CLI hostname + id: baas_cli_poll + if: matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') + echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT + + # App names are limited to 32 characters, so the appNamePrefix should not exceed 22 characters. + - name: Run tests + working-directory: packages + run: > + ./gradlew :test-${{ matrix.type }}:jvmTest + -PsyncUsePlatformNetworking=true + -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} + -PincludeSdkModules=false + --info --no-daemon + + - name: Publish Unit Test Results + uses: dorny/test-reporter@v1 + if: always() || failure() + with: + name: ${{ matrix.test-title }} + path: ./packages/test-${{ matrix.type }}/build/**/TEST-*.xml + reporter: java-junit + list-suites: failed + list-tests: failed + fail-on-error: true + + - name: Stopping the BAAS container + if: always() && matrix.type == 'sync' + working-directory: baasaas + env: + APIKEY: ${{ secrets.BAAS_CLI_API_KEY }} + run: | + if [ -n "${{ steps.baas_cli_start.outputs.baas_container_id }}" ]; then + bash cli.sh stop ${{ steps.baas_cli_start.outputs.baas_container_id }} + fi + + package-all-artifacts: + runs-on: ubuntu-latest + needs: [check-cache, build-jvm-packages, build-android-packages, build-macos-x64-packages, build-macos-arm64-packages, build-ios-x64-packages, build-ios-arm64-packages, build-kotlin-metadata-package] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # The Metadata artifact contain broken JVM publications, so it needs to be + # restored first, it so they can be overidden with the correct ones. + - name: Restore Kotlin metadata artifacts + uses: actions/download-artifact@v3 + with: + name: packages-metadata-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore Android artifacts + uses: actions/download-artifact@v3 + with: + name: packages-android-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore JVM artifacts + uses: actions/download-artifact@v3 + with: + name: packages-jvm-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore MacOS x64 artifacts + uses: actions/download-artifact@v3 + with: + name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore MacOS arm64 artifacts + uses: actions/download-artifact@v3 + with: + name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore iOS x64 artifacts + uses: actions/download-artifact@v3 + with: + name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Restore iOS arm64 artifacts + uses: actions/download-artifact@v3 + with: + name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + + - name: Upload artifacts bundle + uses: actions/upload-artifact@v4 + with: + name: all-packages-${{ needs.check-cache.outputs.version-label }} + path: ./packages/build/m2-buildrepo + retention-days: 7 + + integration-tests: + uses: ./.github/workflows/include-integration-tests.yml + needs: [check-cache, package-all-artifacts] + if: | + always() && + !cancelled() && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') + with: + version-label: ${{ needs.check-cache.outputs.version-label }} + + deploy-snapshot: + uses: ./.github/workflows/include-deploy-snapshot.yml + needs: [ + check-cache, + static-analysis, + integration-tests, + test-jvm-packages, + test-macos-packages, + test-ios-packages, + test-android-packages-emulator, + # test-android-packages-device-farm, + test-android-packages-device-farm-sync, + package-all-artifacts + ] + if: | + always() && + !cancelled() && + endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') + + secrets: inherit + with: + version-label: ${{ needs.check-cache.outputs.version-label }} + + # This job sets an output `is_publish_build` to `true` if this is a release build + check-release-build: + runs-on: ubuntu-latest + needs: [check-cache] + outputs: + is_publish_build: ${{ steps.check_release.outputs.is_publish_build }} + + steps: + - uses: actions/checkout@v4 + + - name: Check if release build + id: check_release + run: | + git fetch --tags + gitTag=$(git describe --tags --exact-match HEAD) || echo "NONE" + echo "Git branch/tag: ${GITHUB_REF}/${gitTag:-'none'}" + + if [[ -z "$gitTag" ]]; then + gitSha=$(git rev-parse HEAD | cut -c1-8) + echo "Building commit: ${{ needs.check-cache.outputs.version-label }} - ${gitSha}" + echo "is_publish_build=false" >> $GITHUB_OUTPUT + else + if [[ "$gitTag" != "v${{ needs.check-cache.outputs.version-label }}" ]]; then + echo "Git tag '${gitTag}' does not match v${{ needs.check-cache.outputs.version-label }}" + echo "is_publish_build=false" >> $GITHUB_OUTPUT + else + echo "Building release: '${gitTag}'" + echo "is_publish_build=true" >> $GITHUB_OUTPUT + fi + fi + + + - name: Print is release build + run: | + echo "Is release build: ${{ steps.check_release.outputs.is_publish_build }}" + + deploy-release: + uses: ./.github/workflows/include-deploy-release.yml + needs: [ + check-cache, + check-release-build, + static-analysis, + integration-tests, + test-jvm-packages, + test-macos-packages, + test-ios-packages, + test-android-packages-emulator, + # test-android-packages-device-farm, + test-android-packages-device-farm-sync, + package-all-artifacts + ] + if: | + always() && + !cancelled() && + !endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && + !contains(needs.*.result, 'failure') && + !contains(needs.*.result, 'cancelled') && + (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') && + (needs.check-release-build.outputs.is_publish_build == 'true') - # - name: Print is release build - # run: | - # echo "Is release build: ${{ steps.check_release.outputs.is_publish_build }}" - - # deploy-release: - # uses: ./.github/workflows/include-deploy-release.yml - # needs: [ - # check-cache, - # check-release-build, - # static-analysis, - # integration-tests, - # test-jvm-packages, - # test-macos-packages, - # test-ios-packages, - # test-android-packages-emulator, - # # test-android-packages-device-farm, - # test-android-packages-device-farm-sync, - # package-all-artifacts - # ] - # if: | - # always() && - # !cancelled() && - # !endsWith(needs.check-cache.outputs.version-label, '-SNAPSHOT') && - # !contains(needs.*.result, 'failure') && - # !contains(needs.*.result, 'cancelled') && - # (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/releases' || github.ref == 'refs/heads/release/k2') && - # (needs.check-release-build.outputs.is_publish_build == 'true') - - # secrets: inherit - # with: - # version-label: ${{ needs.check-cache.outputs.version-label }} - # packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }} + secrets: inherit + with: + version-label: ${{ needs.check-cache.outputs.version-label }} + packages-sha-label: ${{ needs.check-cache.outputs.packages-sha }} \ No newline at end of file From c81f51d16c8bed8dda503bef6de57d2e9aa5e2b7 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 00:49:37 +0200 Subject: [PATCH 31/74] add matcher --- .github/workflows/pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 09a61ff734..32ec71161a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -503,6 +503,9 @@ jobs: needs.check-cache.outputs.android-test-sync-apk-cache-hit != 'true') steps: + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" - name: Remove unnecessary files run: | sudo rm -rf /usr/share/dotnet From 90d211fd0f156d76830d3edff3fe4b826152de9a Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 00:53:41 +0200 Subject: [PATCH 32/74] testing --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 32ec71161a..afe76f76c8 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,7 +33,7 @@ jobs: # with SWIG if we compile on each seperate platform. build-jni-swig-stub: runs-on: ubuntu-latest - needs: check-cache + needs: jni-stub if: always() && !cancelled() && needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - name: Checkout code From aa32dbe63823b72b16d6dad50f5e4e6edacd4bf8 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 00:58:36 +0200 Subject: [PATCH 33/74] fix inputs --- .github/workflows/include-check-cache.yml | 39 ++++++++++++----------- .github/workflows/pr.yml | 2 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 26be5febc7..e8f24b94e0 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -20,38 +20,39 @@ on: outputs: version-label: value: ${{ jobs.check-cache.outputs.version-label }} + packages-sha: + value: ${{ jobs.check-cache.outputs.packages-sha }} + benchmarks-sha: + value: ${{ jobs.check-cache.outputs.benchmarks-sha }} + core-commit-sha: + value: ${{ jobs.check-cache.outputs.core-commit-sha }} + packages-metadata-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-metadata-cache-hit }} + value: ${{ jobs.metadata-compiler-plugin.outputs.packages-metadata-cache-hit }} packages-jvm-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-jvm-cache-hit }} + value: ${{ jobs.jvm-all.outputs.packages-jvm-cache-hit }} packages-android-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-android-cache-hit }} + value: ${{ jobs.android.outputs.packages-android-cache-hit }} android-test-base-apk-cache-hit: - value: ${{ jobs.check-cache.outputs.android-test-base-apk-cache-hit }} + value: ${{ jobs.android-test-base.outputs.android-test-base-apk-cache-hit }} android-test-sync-apk-cache-hit: - value: ${{ jobs.check-cache.outputs.android-test-sync-apk-cache-hit }} + value: ${{ jobs.android-test-sync.outputs.android-test-sync-apk-cache-hit }} packages-macos-x64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-macos-x64-cache-hit }} + value: ${{ jobs.macos-x64.outputs.packages-macos-x64-cache-hit }} packages-macos-arm64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-macos-arm64-cache-hit }} + value: ${{ jobs.macos-arm.outputs.packages-macos-arm64-cache-hit }} packages-ios-x64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-ios-x64-cache-hit }} + value: ${{ jobs.ios-x64.outputs.packages-ios-x64-cache-hit }} packages-ios-arm64-cache-hit: - value: ${{ jobs.check-cache.outputs.packages-ios-arm64-cache-hit }} + value: ${{ jobs.ios-arm.outputs.packages-ios-arm64-cache-hit }} jni-swig-stub-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-swig-stub-cache-hit }} + value: ${{ jobs.jni-stub.outputs.jni-swig-stub-cache-hit }} jni-linux-lib-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-linux-lib-cache-hit }} + value: ${{ jobs.jni-linux-lib.outputs.jni-linux-lib-cache-hit }} jni-macos-lib-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-macos-lib-cache-hit }} + value: ${{ jobs.jni-macos-lib.outputs.jni-macos-lib-cache-hit }} jni-windows-lib-cache-hit: - value: ${{ jobs.check-cache.outputs.jni-windows-lib-cache-hit }} - packages-sha: - value: ${{ jobs.check-cache.outputs.packages-sha }} - benchmarks-sha: - value: ${{ jobs.check-cache.outputs.benchmarks-sha }} - core-commit-sha: - value: ${{ jobs.check-cache.outputs.core-commit-sha }} + value: ${{ jobs.jni-windows-lib.outputs.jni-windows-lib-cache-hit }} jobs: checksum: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index afe76f76c8..32ec71161a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -33,7 +33,7 @@ jobs: # with SWIG if we compile on each seperate platform. build-jni-swig-stub: runs-on: ubuntu-latest - needs: jni-stub + needs: check-cache if: always() && !cancelled() && needs.check-cache.outputs.jni-swig-stub-cache-hit != 'true' steps: - name: Checkout code From c42d7bbe71cc80afa92a48c666004a5503418ad0 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 01:02:37 +0200 Subject: [PATCH 34/74] bum download artifacts --- .github/workflows/pr.yml | 51 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 32ec71161a..e97cf6494e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -120,7 +120,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ./packages/jni-swig-stub/build/generated/sources/jni @@ -197,7 +197,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni @@ -298,7 +298,7 @@ jobs: key: jni-macos-lib-${{ needs.check-cache.outputs.packages-sha }} - name: Restore JNI Swig Stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-stub-${{ needs.check-cache.outputs.version-label }} path: ${{ github.workspace }}/packages/jni-swig-stub/build/generated/sources/jni @@ -462,19 +462,19 @@ jobs: key: packages-m2-jvm-sync-${{ needs.check-cache.outputs.packages-sha }} - name: Restore Linux JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-linux-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmLinuxBuild - name: Restore Windows JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-windows-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmWindowsBuild/Release - name: Restore MacOS JNI lib - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: jni-macos-lib-${{ needs.check-cache.outputs.version-label }} path: ./packages/cinterop/build/realmMacOsBuild @@ -503,9 +503,6 @@ jobs: needs.check-cache.outputs.android-test-sync-apk-cache-hit != 'true') steps: - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - name: Remove unnecessary files run: | sudo rm -rf /usr/share/dotnet @@ -981,19 +978,19 @@ jobs: cache-read-only: false - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore m2-buildrepo (Android) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-android-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore m2-buildrepo (JVM) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1076,7 +1073,7 @@ jobs: uses: actions/checkout@v4 - name: Restore Android Test APK - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: android-base-test-apk-${{ needs.check-cache.outputs.version-label }} path: ./packages/test-base/build/outputs/apk/androidTest/debug @@ -1130,7 +1127,7 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Restore Android Sync Test APK - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: android-sync-test-apk-${{ needs.check-cache.outputs.version-label }} path: ./packages/test-sync/build/outputs/apk/ @@ -1242,13 +1239,13 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1364,13 +1361,13 @@ jobs: cache-read-only: false - name: Restore m2-buildrepo (ios) - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-ios-${{ matrix.package-prefix }}-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1498,13 +1495,13 @@ jobs: cache-read-only: false - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore m2-buildrepo - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo @@ -1567,43 +1564,43 @@ jobs: # The Metadata artifact contain broken JVM publications, so it needs to be # restored first, it so they can be overidden with the correct ones. - name: Restore Kotlin metadata artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-metadata-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore Android artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-android-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore JVM artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-jvm-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore MacOS x64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-macos-x64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore MacOS arm64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-macos-arm64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore iOS x64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-ios-x64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo - name: Restore iOS arm64 artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: packages-ios-arm64-${{ needs.check-cache.outputs.version-label }} path: ./packages/build/m2-buildrepo From 39867bf0713b95071417779d6ce1a08d9ee5ae04 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 09:19:59 +0200 Subject: [PATCH 35/74] fix name --- .github/workflows/include-check-cache.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index e8f24b94e0..d5845f0dcf 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -352,7 +352,7 @@ jobs: # # MacOS x64 # - macos-x86: + macos-x64: runs-on: ubuntu-latest needs: checksum name: MacOS x64 @@ -411,7 +411,6 @@ jobs: name: iOS x64 outputs: packages-ios-x64-cache-hit: ${{ steps.ios-x64-cache.outputs.cache-hit }} - packages-ios-arm64-cache-hit: ${{ steps.ios-arm64-cache.outputs.cache-hit }} steps: - name: Check iOS X64 cache From 671b16b239cb044e51f355e08e1296d31b0b4c2b Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 09:28:45 +0200 Subject: [PATCH 36/74] test --- .github/workflows/include-check-cache.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index d5845f0dcf..8b9d6d9919 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -59,10 +59,10 @@ jobs: runs-on: ubuntu-latest name: Cache SHA outputs: - version-label: ${{ steps.find-library-version.outputs.label }} + version-label: ${{ steps.find-library-.outputs.label }} packages-sha: ${{ steps.packages-cache-key.outputs.sha }} benchmarks-sha: ${{ steps.calculate-benchmarks-cache-key.outputs.sha }} - core-commit-sha: ${{ steps.calculate-core-commmit-sha.outputs.commit }} + core-commit-sha: ${{ steps.calculate-core-versioncommmit-sha.outputs.commit }} steps: - name: Checkout code @@ -74,6 +74,7 @@ jobs: id: find-library-version run: | version=$(grep "const val version" buildSrc/src/main/kotlin/Config.kt | cut -d \" -f2) + echo "Label: $version" echo "label=$version" >> $GITHUB_OUTPUT # This also include changes to Realm Core as they are hashed as part of `/packages/external/core` @@ -105,12 +106,12 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-metadata-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-metadata-${{ steps.checksum.outputs.sha }} - name: Save Kotlin Metadata packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' with: - name: packages-metadata-${{ steps.find-library-version.outputs.label }} + name: packages-metadata-${{ steps.checksum.outputs.label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 From d3afc830fd6ab0d068399b2b618abb6f5d0e1030 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 09:41:33 +0200 Subject: [PATCH 37/74] more testing --- .github/workflows/include-check-cache.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 8b9d6d9919..0d9331d870 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -101,6 +101,13 @@ jobs: outputs: packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} steps: + - name: Testing + id: testing + run: | + echo "checksum.sha: ${{ steps.checksum.outputs.sha }}" + echo "checksum.label: ${{ steps.checksum.outputs.label }}" + echo "packages-cache-key: ${{ steps.packages-cache-key.outputs.sha }}" + echo "find-library-version: ${{ steps.find-library-version.outputs.label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From 3e843c4b0095e2c5543e433e4bf5abc0c3b24ede Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 09:45:57 +0200 Subject: [PATCH 38/74] more testing --- .github/workflows/include-check-cache.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 0d9331d870..7bd4d9231c 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -104,10 +104,9 @@ jobs: - name: Testing id: testing run: | - echo "checksum.sha: ${{ steps.checksum.outputs.sha }}" - echo "checksum.label: ${{ steps.checksum.outputs.label }}" - echo "packages-cache-key: ${{ steps.packages-cache-key.outputs.sha }}" - echo "find-library-version: ${{ steps.find-library-version.outputs.label }}" + echo "version-label: ${{ version-label }}" + echo "outputs.version-label: ${{ outputs.version-label }}" + echo "jobs.check-cache.outputs.version-label: ${{ jobs.check-cache.outputs.version-label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From 302de3f7df1b5f729bea9dba82e9646473d12101 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 09:50:10 +0200 Subject: [PATCH 39/74] more testing --- .github/workflows/include-check-cache.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 7bd4d9231c..32acf6bf94 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -104,7 +104,6 @@ jobs: - name: Testing id: testing run: | - echo "version-label: ${{ version-label }}" echo "outputs.version-label: ${{ outputs.version-label }}" echo "jobs.check-cache.outputs.version-label: ${{ jobs.check-cache.outputs.version-label }}" - name: Check Kotlin Metadata cache From 890976087273f4688065957ba7fc2dec8c5b7d86 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 09:51:50 +0200 Subject: [PATCH 40/74] Testing --- .github/workflows/include-check-cache.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 32acf6bf94..416dd3d939 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -104,7 +104,6 @@ jobs: - name: Testing id: testing run: | - echo "outputs.version-label: ${{ outputs.version-label }}" echo "jobs.check-cache.outputs.version-label: ${{ jobs.check-cache.outputs.version-label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache From fea70a7a27eaaebfff966d1189f97da5f0df30a4 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:02:54 +0200 Subject: [PATCH 41/74] test --- .github/workflows/include-check-cache.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 416dd3d939..60cd7e6985 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -104,7 +104,8 @@ jobs: - name: Testing id: testing run: | - echo "jobs.check-cache.outputs.version-label: ${{ jobs.check-cache.outputs.version-label }}" + echo "checksum.sha: ${{ checksum.outputs.sha }}" + echo "checksum.label: ${{ checksum.outputs.label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From ade16719f6331c1425dcd14f68159a9c861cb96e Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:07:55 +0200 Subject: [PATCH 42/74] test --- .github/workflows/include-check-cache.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 60cd7e6985..c97af7f60c 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -104,8 +104,8 @@ jobs: - name: Testing id: testing run: | - echo "checksum.sha: ${{ checksum.outputs.sha }}" - echo "checksum.label: ${{ checksum.outputs.label }}" + echo "checksum.sha: ${{ checksum.outputs.packages-sha }}" + echo "checksum.label: ${{ checksum.outputs.version-label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From 96c6bbe71b6293804263df1c8ad46834773492c5 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:11:02 +0200 Subject: [PATCH 43/74] test --- .github/workflows/include-check-cache.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index c97af7f60c..29778f080a 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -104,8 +104,8 @@ jobs: - name: Testing id: testing run: | - echo "checksum.sha: ${{ checksum.outputs.packages-sha }}" - echo "checksum.label: ${{ checksum.outputs.version-label }}" + echo "checksum.sha: ${{ outputs.packages-sha }}" + echo "checksum.label: ${{ outputs.version-label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From 9c6b3655f86dc6cf99c29ae6c2d49fbe660817b3 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:13:38 +0200 Subject: [PATCH 44/74] test --- .github/workflows/include-check-cache.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 29778f080a..8c5367750c 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -19,13 +19,13 @@ on: workflow_call: outputs: version-label: - value: ${{ jobs.check-cache.outputs.version-label }} + value: ${{ jobs.checksum.outputs.version-label }} packages-sha: - value: ${{ jobs.check-cache.outputs.packages-sha }} + value: ${{ jobs.checksum.outputs.packages-sha }} benchmarks-sha: - value: ${{ jobs.check-cache.outputs.benchmarks-sha }} + value: ${{ jobs.checksum.outputs.benchmarks-sha }} core-commit-sha: - value: ${{ jobs.check-cache.outputs.core-commit-sha }} + value: ${{ jobs.checksum.outputs.core-commit-sha }} packages-metadata-cache-hit: value: ${{ jobs.metadata-compiler-plugin.outputs.packages-metadata-cache-hit }} @@ -104,8 +104,7 @@ jobs: - name: Testing id: testing run: | - echo "checksum.sha: ${{ outputs.packages-sha }}" - echo "checksum.label: ${{ outputs.version-label }}" + echo "label: ${{ jobs.checksum.outputs.version-label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From 3c8e5dd376e61286fa3f3db1f4e3e9edef18516f Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:15:45 +0200 Subject: [PATCH 45/74] test --- .github/workflows/include-check-cache.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index 8c5367750c..faf33ba7ca 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -101,10 +101,6 @@ jobs: outputs: packages-metadata-cache-hit: ${{ steps.kotlin-metadata-cache.outputs.cache-hit }} steps: - - name: Testing - id: testing - run: | - echo "label: ${{ jobs.checksum.outputs.version-label }}" - name: Check Kotlin Metadata cache id: kotlin-metadata-cache uses: actions/cache@v4 From e663d5c1b37d542b5ac607ef58f4ba9c489f3f14 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:25:37 +0200 Subject: [PATCH 46/74] testing --- .github/workflows/include-check-cache.yml | 55 ++++++++++++----------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/include-check-cache.yml b/.github/workflows/include-check-cache.yml index faf33ba7ca..c07dbe68f8 100644 --- a/.github/workflows/include-check-cache.yml +++ b/.github/workflows/include-check-cache.yml @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-latest name: Cache SHA outputs: - version-label: ${{ steps.find-library-.outputs.label }} + version-label: ${{ steps.find-library-version.outputs.label }} packages-sha: ${{ steps.packages-cache-key.outputs.sha }} benchmarks-sha: ${{ steps.calculate-benchmarks-cache-key.outputs.sha }} core-commit-sha: ${{ steps.calculate-core-versioncommmit-sha.outputs.commit }} @@ -106,12 +106,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-metadata-${{ steps.checksum.outputs.sha }} + key: packages-m2-metadata-${{ needs.checksum.outputs.packages-sha }} + - name: Save Kotlin Metadata packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.kotlin-metadata-cache.outputs.cache-hit == 'true' with: - name: packages-metadata-${{ steps.checksum.outputs.label }} + name: packages-metadata-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 @@ -131,13 +132,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-jvm-sync-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-jvm-sync-${{ needs.checksum.outputs.packages-sha }} - name: Save JVM packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jvm-cache.outputs.cache-hit == 'true' with: - name: packages-jvm-${{ steps.find-library-version.outputs.label }} + name: packages-jvm-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 @@ -157,13 +158,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/jni-swig-stub/build/generated/sources/jni - key: jni-swig-stubs-${{ steps.packages-cache-key.outputs.sha }} + key: jni-swig-stubs-${{ needs.checksum.outputs.packages-sha }} - name: Save JNI Stub packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-swig-stub-cache.outputs.cache-hit == 'true' with: - name: jni-stub-${{ steps.find-library-version.outputs.label }} + name: jni-stub-${{ needs.checksum.outputs.version-label }} path: ./packages/jni-swig-stub/build/generated/sources/jni/* retention-days: 1 @@ -183,12 +184,12 @@ jobs: uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmMacOsBuild - key: jni-macos-lib-${{ steps.packages-cache-key.outputs.sha }} + key: jni-macos-lib-${{ needs.checksum.outputs.packages-sha }} - name: Save JNI MacOS lib package uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-macos-lib-cache.outputs.cache-hit == 'true' with: - name: jni-macos-lib-${{ steps.find-library-version.outputs.label }} + name: jni-macos-lib-${{ needs.checksum.outputs.version-label }} path: ./packages/cinterop/build/realmMacOsBuild/**/* retention-days: 1 @@ -208,13 +209,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmLinuxBuild - key: jni-linux-lib-${{ steps.packages-cache-key.outputs.sha }} + key: jni-linux-lib-${{ needs.checksum.outputs.packages-sha }} - name: Save JNI Linux lib package uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-linux-lib-cache.outputs.cache-hit == 'true' with: - name: jni-linux-lib-${{ steps.find-library-version.outputs.label }} + name: jni-linux-lib-${{ needs.checksum.outputs.version-label }} path: ./packages/cinterop/build/realmLinuxBuild/**/* retention-days: 1 @@ -233,14 +234,14 @@ jobs: uses: actions/cache@v4 with: path: ./packages/cinterop/build/realmWindowsBuild - key: jni-windows-lib-${{ steps.packages-cache-key.outputs.sha }} + key: jni-windows-lib-${{ needs.checksum.outputs.packages-sha }} enableCrossOsArchive: true - name: Save JNI Windows lib package uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.jni-windows-lib-cache.outputs.cache-hit == 'true' with: - name: jni-windows-lib-${{ steps.find-library-version.outputs.label }} + name: jni-windows-lib-${{ needs.checksum.outputs.version-label }} path: ./packages/cinterop/build/realmWindowsBuild/Release/realmc.dll retention-days: 1 # @@ -259,13 +260,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-android-sync-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-android-sync-${{ needs.checksum.outputs.packages-sha }} - name: Save Android packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.android-cache.outputs.cache-hit == 'true' with: - name: packages-android-${{ steps.find-library-version.outputs.label }} + name: packages-android-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 @@ -285,12 +286,12 @@ jobs: uses: actions/cache@v4 with: path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk - key: android-base-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + key: android-base-test-apk-key-${{ needs.checksum.outputs.packages-sha }} - name: Save Android Base Test APK uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.android-test-base-apk.outputs.cache-hit == 'true' with: - name: android-base-test-apk-${{ steps.find-library-version.outputs.label }} + name: android-base-test-apk-${{ needs.checksum.outputs.version-label }} path: ./packages/test-base/build/outputs/apk/androidTest/debug/test-base-debug-androidTest.apk retention-days: 1 @@ -309,7 +310,7 @@ jobs: id: android-test-sync-apk uses: actions/cache@v4 with: - key: android-sync-test-apk-key-${{ steps.packages-cache-key.outputs.sha }} + key: android-sync-test-apk-key-${{ needs.checksum.outputs.packages-sha }} path: | ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk ./packages/test-sync/build/outputs/apk/debug/test-sync-debug.apk @@ -318,7 +319,7 @@ jobs: uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.android-test-sync-apk.outputs.cache-hit == 'true' with: - name: android-sync-test-apk-${{ steps.find-library-version.outputs.label }} + name: android-sync-test-apk-${{ needs.checksum.outputs.version-label }} retention-days: 1 path: | ./packages/test-sync/build/outputs/apk/androidTest/debug/test-sync-debug-androidTest.apk @@ -340,13 +341,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-macos-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-macos-arm64-sync-${{ needs.checksum.outputs.packages-sha }} - name: Save MacOS arm64 packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.macos-arm64-cache.outputs.cache-hit == 'true' with: - name: packages-macos-arm64-${{ steps.find-library-version.outputs.label }} + name: packages-macos-arm64-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 @@ -366,13 +367,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-macos-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-macos-x64-sync-${{ needs.checksum.outputs.packages-sha }} - name: Save MacOS x64 packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.macos-x64-cache.outputs.cache-hit == 'true' with: - name: packages-macos-x64-${{ steps.find-library-version.outputs.label }} + name: packages-macos-x64-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 @@ -393,13 +394,13 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-ios-arm64-sync-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-ios-arm64-sync-${{ needs.checksum.outputs.packages-sha }} - name: Save iOS arm64 packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.ios-arm64-cache.outputs.cache-hit == 'true' with: - name: packages-ios-arm64-${{ steps.find-library-version.outputs.label }} + name: packages-ios-arm64-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 @@ -419,12 +420,12 @@ jobs: uses: actions/cache@v4 with: path: ./packages/build/m2-buildrepo - key: packages-m2-ios-x64-sync-${{ steps.packages-cache-key.outputs.sha }} + key: packages-m2-ios-x64-sync-${{ needs.checksum.outputs.packages-sha }} - name: Save iOS x64 packages uses: actions/upload-artifact@v4 if: always() && !cancelled() && steps.ios-x64-cache.outputs.cache-hit == 'true' with: - name: packages-ios-x64-${{ steps.find-library-version.outputs.label }} + name: packages-ios-x64-${{ needs.checksum.outputs.version-label }} path: ./packages/build/m2-buildrepo/**/* retention-days: 1 From 0e896b3417dd75305eed8c306ea5db2c02b4752e Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 10:48:41 +0200 Subject: [PATCH 47/74] some updates --- .github/workflows/pr.yml | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e97cf6494e..d5f858e586 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -42,13 +42,13 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -59,7 +59,7 @@ jobs: key: jni-swig-stubs-${{ needs.check-cache.outputs.packages-sha }} - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -115,7 +115,7 @@ jobs: key: jni-linux-lib-${{ needs.check-cache.outputs.packages-sha }} - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -192,7 +192,7 @@ jobs: enableCrossOsArchive: true - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -245,18 +245,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -331,18 +331,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -411,18 +411,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -514,13 +514,13 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -545,7 +545,7 @@ jobs: run: brew install jq - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -649,18 +649,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -718,18 +718,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -786,18 +786,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -855,18 +855,18 @@ jobs: submodules: "recursive" - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 + uses: jwlawson/actions-setup-cmake@v2.0.2 with: cmake-version: ${{ vars.VERSION_CMAKE }} @@ -967,13 +967,13 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1228,13 +1228,13 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1350,13 +1350,13 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false @@ -1484,13 +1484,13 @@ jobs: echo "baas_container_id=$OUTPUT" >> $GITHUB_OUTPUT - name: Setup Java 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ vars.VERSION_JAVA_DISTRIBUTION }} java-version: ${{ vars.VERSION_JAVA }} - name: Setup Gradle and task/dependency caching - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 with: cache-read-only: false From 0588b636e14227768851d675d1f2892073f0b63c Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 11:05:19 +0200 Subject: [PATCH 48/74] bump version --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d5f858e586..90b8bb8e22 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -126,7 +126,7 @@ jobs: path: ./packages/jni-swig-stub/build/generated/sources/jni - name: Build Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: tags: jvm-native-lib-linux:latest file: ./packages/cinterop/src/jvmMain/generic.Dockerfile From 47c7e212bf2d0185f5ea9daa98ba102dce66b3ea Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 11:16:23 +0200 Subject: [PATCH 49/74] bump ccache action --- .github/workflows/include-deploy-release.yml | 2 +- .github/workflows/pr.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 7af6718f8b..61e62e2466 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -44,7 +44,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'jvm-package' max-size: '2.0G' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 90b8bb8e22..19cd78b541 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -266,7 +266,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'jvm-macos-native-lib' max-size: '2.0G' @@ -352,7 +352,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'metadata-package' max-size: '2.0G' @@ -432,7 +432,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'jvm-package' max-size: '2.0G' @@ -555,7 +555,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'android-package' max-size: '2.0G' @@ -670,7 +670,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'macos-x64-package' max-size: '2.0G' @@ -739,7 +739,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'macos-arm64-package' max-size: '2.0G' @@ -807,7 +807,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'ios-x64-package' max-size: '2.0G' @@ -876,7 +876,7 @@ jobs: version: ${{ vars.VERSION_NINJA }} - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2.2 + uses: hendrikmuhs/ccache-action@v1.2.13 with: key: 'ios-arm64-package' max-size: '2.0G' From 9502fe4e18e6b2b17ba5a9b8d149a5e1fcf06c95 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 11:49:16 +0200 Subject: [PATCH 50/74] bump setup ninja --- .github/workflows/include-deploy-release.yml | 2 +- .github/workflows/pr.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/include-deploy-release.yml b/.github/workflows/include-deploy-release.yml index 61e62e2466..7e5bd70819 100644 --- a/.github/workflows/include-deploy-release.yml +++ b/.github/workflows/include-deploy-release.yml @@ -39,7 +39,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 19cd78b541..74c736aa74 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -261,7 +261,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -347,7 +347,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -427,7 +427,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -550,7 +550,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -665,7 +665,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -734,7 +734,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -802,7 +802,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} @@ -871,7 +871,7 @@ jobs: cmake-version: ${{ vars.VERSION_CMAKE }} - name: Setup ninja - uses: cmelchior/setup-ninja@master + uses: clementetb/setup-ninja@master with: version: ${{ vars.VERSION_NINJA }} From 7bdb4d5cd466a829ef1e4b5954363dcaa282dbb9 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 14:24:10 +0200 Subject: [PATCH 51/74] upgrade aws-credentials --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 74c736aa74..3c3ce6385b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1079,7 +1079,7 @@ jobs: path: ./packages/test-base/build/outputs/apk/androidTest/debug - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} @@ -1133,7 +1133,7 @@ jobs: path: ./packages/test-sync/build/outputs/apk/ - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_DEVICEFARM_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }} From 7d8ef23152808b4a0591780de956edb38f262077 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 15:45:22 +0200 Subject: [PATCH 52/74] introduce linting issue --- .../jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt b/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt index 97f948eafb..6ab976dc12 100644 --- a/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt +++ b/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt @@ -29,6 +29,8 @@ internal actual fun realmObjectCompanionOrNull(clazz: KClass): Real clazz.companionObjectInstance as RealmObjectCompanion } else null + + @PublishedApi internal actual fun realmObjectCompanionOrThrow(clazz: KClass): RealmObjectCompanion = realmObjectCompanionOrNull(clazz) From 0016ab8b27ba4f6e4e0c93b396e02e3a5265e333 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 16:07:59 +0200 Subject: [PATCH 53/74] Add ktlint matcher --- .github/problem-matchers/ktlint.json | 17 ++++++ .github/workflows/include-static-analysis.yml | 52 +++++++++++-------- .../src/main/kotlin/realm-lint.gradle.kts | 1 + 3 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 .github/problem-matchers/ktlint.json diff --git a/.github/problem-matchers/ktlint.json b/.github/problem-matchers/ktlint.json new file mode 100644 index 0000000000..924000e815 --- /dev/null +++ b/.github/problem-matchers/ktlint.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "ktlint", + "severity": "error", + "pattern": [ + { + "regexp": "(.+\\.kt):(\\d+):(\\d+):\\s(.*)", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +} diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 64f11b5fb8..2b280be716 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -27,31 +27,39 @@ jobs: working-directory: packages run: ./gradlew :gradle-plugin:publishAllPublicationsToTestRepository --info --stacktrace + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/ktlint.json" + - name: Run Ktlint run: ./gradlew ktlintCheck - - name: Stash Ktlint results - if: always() - run: | - rm -rf /tmp/ktlint - rm -rf /tmp/detekt - mkdir /tmp/ktlint - mkdir /tmp/detekt - rsync -a --delete --ignore-errors examples/kmm-sample/shared/build/reports/ktlint/ /tmp/ktlint/example/ || true - rsync -a --delete --ignore-errors packages/cinterop/build/reports/ktlint/ /tmp/ktlint/cinterop/ || true - rsync -a --delete --ignore-errors packages/library-base/build/reports/ktlint/ /tmp/ktlint/library-base/ || true - rsync -a --delete --ignore-errors packages/library-sync/build/reports/ktlint/ /tmp/ktlint/library-sync/ || true - rsync -a --delete --ignore-errors packages/plugin-compiler/build/reports/ktlint/ /tmp/ktlint/plugin-compiler/ || true - rsync -a --delete --ignore-errors packages/gradle-plugin/build/reports/ktlint/ /tmp/ktlint/plugin-gradle/ || true - rsync -a --delete --ignore-errors benchmarks/build/reports/ktlint/ /tmp/ktlint/benchmarks/ || true - - - name: Publish Ktlint results - uses: clementetb/checkstyle-github-action@master - if: always() - with: - name: Ktlint Results - title: Ktlint Analyzer report - path: '/tmp/ktlint/**/*.xml' + - name: Register problem matchers + run: |- + echo "::remove-matcher owner=ktlint::" + + # - name: Stash Ktlint results + # if: always() + # run: | + # rm -rf /tmp/ktlint + # rm -rf /tmp/detekt + # mkdir /tmp/ktlint + # mkdir /tmp/detekt + # rsync -a --delete --ignore-errors examples/kmm-sample/shared/build/reports/ktlint/ /tmp/ktlint/example/ || true + # rsync -a --delete --ignore-errors packages/cinterop/build/reports/ktlint/ /tmp/ktlint/cinterop/ || true + # rsync -a --delete --ignore-errors packages/library-base/build/reports/ktlint/ /tmp/ktlint/library-base/ || true + # rsync -a --delete --ignore-errors packages/library-sync/build/reports/ktlint/ /tmp/ktlint/library-sync/ || true + # rsync -a --delete --ignore-errors packages/plugin-compiler/build/reports/ktlint/ /tmp/ktlint/plugin-compiler/ || true + # rsync -a --delete --ignore-errors packages/gradle-plugin/build/reports/ktlint/ /tmp/ktlint/plugin-gradle/ || true + # rsync -a --delete --ignore-errors benchmarks/build/reports/ktlint/ /tmp/ktlint/benchmarks/ || true + + # - name: Publish Ktlint results + # uses: clementetb/checkstyle-github-action@master + # if: always() + # with: + # name: Ktlint Results + # title: Ktlint Analyzer report + # path: '/tmp/ktlint/**/*.xml' detekt: runs-on: ubuntu-latest diff --git a/buildSrc/src/main/kotlin/realm-lint.gradle.kts b/buildSrc/src/main/kotlin/realm-lint.gradle.kts index 8a4a1cdc2b..103e939adf 100644 --- a/buildSrc/src/main/kotlin/realm-lint.gradle.kts +++ b/buildSrc/src/main/kotlin/realm-lint.gradle.kts @@ -64,6 +64,7 @@ allprojects { "!src/**/generated/**", "!src/**/resources/**", "--reporter=plain", + "--reporter=html,output=${project.buildDir}/reports/ktlint/ktlint.html", "--reporter=checkstyle,output=${project.buildDir}/reports/ktlint/ktlint.xml", "--editorconfig=${configDir}/ktlint/.editorconfig" ) From f9c49338c9344ef4f24211ab18b836949cd9a41f Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 16:18:11 +0200 Subject: [PATCH 54/74] upload reports --- .github/workflows/include-static-analysis.yml | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 2b280be716..08324a6ede 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -34,32 +34,33 @@ jobs: - name: Run Ktlint run: ./gradlew ktlintCheck - - name: Register problem matchers + - name: Deregister problem matchers + if: always() run: |- echo "::remove-matcher owner=ktlint::" - # - name: Stash Ktlint results - # if: always() - # run: | - # rm -rf /tmp/ktlint - # rm -rf /tmp/detekt - # mkdir /tmp/ktlint - # mkdir /tmp/detekt - # rsync -a --delete --ignore-errors examples/kmm-sample/shared/build/reports/ktlint/ /tmp/ktlint/example/ || true - # rsync -a --delete --ignore-errors packages/cinterop/build/reports/ktlint/ /tmp/ktlint/cinterop/ || true - # rsync -a --delete --ignore-errors packages/library-base/build/reports/ktlint/ /tmp/ktlint/library-base/ || true - # rsync -a --delete --ignore-errors packages/library-sync/build/reports/ktlint/ /tmp/ktlint/library-sync/ || true - # rsync -a --delete --ignore-errors packages/plugin-compiler/build/reports/ktlint/ /tmp/ktlint/plugin-compiler/ || true - # rsync -a --delete --ignore-errors packages/gradle-plugin/build/reports/ktlint/ /tmp/ktlint/plugin-gradle/ || true - # rsync -a --delete --ignore-errors benchmarks/build/reports/ktlint/ /tmp/ktlint/benchmarks/ || true - - # - name: Publish Ktlint results - # uses: clementetb/checkstyle-github-action@master - # if: always() - # with: - # name: Ktlint Results - # title: Ktlint Analyzer report - # path: '/tmp/ktlint/**/*.xml' + - name: Stash Ktlint results + if: always() + run: | + rm -rf /tmp/ktlint + rm -rf /tmp/detekt + mkdir /tmp/ktlint + mkdir /tmp/detekt + rsync -a --delete --ignore-errors examples/kmm-sample/shared/build/reports/ktlint/ /tmp/ktlint/example/ || true + rsync -a --delete --ignore-errors packages/cinterop/build/reports/ktlint/ /tmp/ktlint/cinterop/ || true + rsync -a --delete --ignore-errors packages/library-base/build/reports/ktlint/ /tmp/ktlint/library-base/ || true + rsync -a --delete --ignore-errors packages/library-sync/build/reports/ktlint/ /tmp/ktlint/library-sync/ || true + rsync -a --delete --ignore-errors packages/plugin-compiler/build/reports/ktlint/ /tmp/ktlint/plugin-compiler/ || true + rsync -a --delete --ignore-errors packages/gradle-plugin/build/reports/ktlint/ /tmp/ktlint/plugin-gradle/ || true + rsync -a --delete --ignore-errors benchmarks/build/reports/ktlint/ /tmp/ktlint/benchmarks/ || true + + - name: Publish Ktlint results + uses: actions/upload-artifact@v4 + if: always() && !cancelled() + with: + name: Ktlint Analyzer report + path: /tmp/ktlint/* + retention-days: 1 detekt: runs-on: ubuntu-latest From 935eff154ba192e74437f40dd570e0a3d54292a5 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 16:32:17 +0200 Subject: [PATCH 55/74] catch detekt errors --- .github/problem-matchers/detekt.json | 18 +++++++++++++++ .github/workflows/include-static-analysis.yml | 23 +++++++++++++------ .../kotlin/gradle/RealmCompilerSubplugin.kt | 1 - 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 .github/problem-matchers/detekt.json diff --git a/.github/problem-matchers/detekt.json b/.github/problem-matchers/detekt.json new file mode 100644 index 0000000000..3fc579eea1 --- /dev/null +++ b/.github/problem-matchers/detekt.json @@ -0,0 +1,18 @@ +{ + "problemMatcher": [ + { + "owner": "detekt", + "severity": "error", + "pattern": [ + { + "regexp": "(.+\.kt):(\d+):(\d+):\s(.*)\s\[(.+)\]", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 08324a6ede..db3f51dbda 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -40,7 +40,7 @@ jobs: echo "::remove-matcher owner=ktlint::" - name: Stash Ktlint results - if: always() + if: always() && !cancelled() run: | rm -rf /tmp/ktlint rm -rf /tmp/detekt @@ -85,11 +85,20 @@ jobs: working-directory: packages run: ./gradlew :gradle-plugin:publishAllPublicationsToTestRepository --info --stacktrace + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/detekt.json" + - name: Run Detekt run: ./gradlew detekt - - name: Stash Detekt results + - name: Deregister problem matchers if: always() + run: |- + echo "::remove-matcher owner=detekt::" + + - name: Stash Detekt results + if: always() && !cancelled() run: | rm -rf /tmp/detekt mkdir /tmp/detekt @@ -102,9 +111,9 @@ jobs: rsync -a --delete --ignore-errors benchmarks/build/reports/detekt/ /tmp/detekt/benchmarks/ || true - name: Publish Detekt results - uses: clementetb/checkstyle-github-action@master - if: always() + uses: actions/upload-artifact@v4 + if: always() && !cancelled() with: - name: Detekt Results - title: Detekt Analyzer report - path: '/tmp/detekt/**/*.xml' + name: Detekt Analyzer report + path: /tmp/detekt/* + retention-days: 1 diff --git a/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt b/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt index 270c67c93b..20a71e3521 100644 --- a/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt +++ b/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt @@ -272,7 +272,6 @@ private fun Provider.safeProvider(): Provider = this.let { } } -@Suppress("ComplexMethod", "NestedBlockDepth") private fun gatherTargetInfo(kotlinCompilation: KotlinCompilation<*>): TargetInfo? { val project = kotlinCompilation.target.project return when (kotlinCompilation) { From d24d46783bec70cbcd2f1c6d780fa591b6839dbe Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 16:42:06 +0200 Subject: [PATCH 56/74] Fix regex --- .github/problem-matchers/detekt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/problem-matchers/detekt.json b/.github/problem-matchers/detekt.json index 3fc579eea1..a89dc763f9 100644 --- a/.github/problem-matchers/detekt.json +++ b/.github/problem-matchers/detekt.json @@ -5,7 +5,7 @@ "severity": "error", "pattern": [ { - "regexp": "(.+\.kt):(\d+):(\d+):\s(.*)\s\[(.+)\]", + "regexp": "(.+\\.kt):(\\d+):(\\d+):\\s(.*)\\s\\[(.+)\\]", "file": 1, "line": 2, "column": 3, From 2dfb9a591076eeddb4785d95a42b1494608e8d31 Mon Sep 17 00:00:00 2001 From: Clemente Date: Thu, 6 Jun 2024 16:58:31 +0200 Subject: [PATCH 57/74] Remove code detection --- .github/problem-matchers/detekt.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/problem-matchers/detekt.json b/.github/problem-matchers/detekt.json index a89dc763f9..9911b4c1a2 100644 --- a/.github/problem-matchers/detekt.json +++ b/.github/problem-matchers/detekt.json @@ -5,12 +5,11 @@ "severity": "error", "pattern": [ { - "regexp": "(.+\\.kt):(\\d+):(\\d+):\\s(.*)\\s\\[(.+)\\]", + "regexp": "(.+\\.kt):(\\d+):(\\d+):\\s(.*)", "file": 1, "line": 2, "column": 3, - "message": 4, - "code": 5 + "message": 4 } ] } From 914c4ab124fac8b869ac28af8303817e6fddfb94 Mon Sep 17 00:00:00 2001 From: Clemente Date: Fri, 7 Jun 2024 23:55:00 +0200 Subject: [PATCH 58/74] update kotlin matcher --- .github/problem-matchers/kotlin.json | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 38754d77ad..30ea39ed12 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -1,11 +1,11 @@ { "problemMatcher": [ { - "owner": "kotlin-error", + "owner": "kotlin", "severity": "error", "pattern": [ { - "regexp": "e:\\s(.+):(\\d+):(\\d+)\\s(.+)", + "regexp": "^e\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", "file": 1, "line": 2, "column": 3, @@ -14,17 +14,27 @@ ] }, { - "owner": "kotlin-warning", + "owner": "kotlin-1.7-warning", "severity": "warning", "pattern": [ { - "regexp": "w:\\s(.+):(\\d+):(\\d+)\\s(.+)", + "regexp": "^w\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", "file": 1, "line": 2, "column": 3, "message": 4 } ] + }, + { + "owner": "gradle-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^WARNING:(.*(?:\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "message": 1 + } + ] } ] } From 58d148c7bace97bc4d8e7478fea25e883aa669e6 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:00:56 +0200 Subject: [PATCH 59/74] Register kotlin matchers --- .github/workflows/include-static-analysis.yml | 23 ++++++++----------- buildSrc/buildSrc/build.gradle.kts | 3 +++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index db3f51dbda..c9a16fd59f 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -13,6 +13,11 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + echo "::add-matcher::.github/problem-matchers/ktlint.json" + - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 with: @@ -27,10 +32,6 @@ jobs: working-directory: packages run: ./gradlew :gradle-plugin:publishAllPublicationsToTestRepository --info --stacktrace - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/ktlint.json" - - name: Run Ktlint run: ./gradlew ktlintCheck @@ -71,6 +72,11 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + echo "::add-matcher::.github/problem-matchers/detekt.json" + - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 with: @@ -85,18 +91,9 @@ jobs: working-directory: packages run: ./gradlew :gradle-plugin:publishAllPublicationsToTestRepository --info --stacktrace - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/detekt.json" - - name: Run Detekt run: ./gradlew detekt - - name: Deregister problem matchers - if: always() - run: |- - echo "::remove-matcher owner=detekt::" - - name: Stash Detekt results if: always() && !cancelled() run: | diff --git a/buildSrc/buildSrc/build.gradle.kts b/buildSrc/buildSrc/build.gradle.kts index fdf7863b64..7c2d033a7c 100644 --- a/buildSrc/buildSrc/build.gradle.kts +++ b/buildSrc/buildSrc/build.gradle.kts @@ -11,3 +11,6 @@ sourceSets.main { include("Config.kt") } } + +val a: Int = "" + From 984a41cd358d089b2ec0aa31144216659d1399e2 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:08:17 +0200 Subject: [PATCH 60/74] test --- .github/workflows/include-static-analysis.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index c9a16fd59f..b88cdbbf3c 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -16,7 +16,6 @@ jobs: - name: Register problem matchers run: |- echo "::add-matcher::.github/problem-matchers/kotlin.json" - echo "::add-matcher::.github/problem-matchers/ktlint.json" - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 @@ -35,11 +34,6 @@ jobs: - name: Run Ktlint run: ./gradlew ktlintCheck - - name: Deregister problem matchers - if: always() - run: |- - echo "::remove-matcher owner=ktlint::" - - name: Stash Ktlint results if: always() && !cancelled() run: | @@ -75,7 +69,6 @@ jobs: - name: Register problem matchers run: |- echo "::add-matcher::.github/problem-matchers/kotlin.json" - echo "::add-matcher::.github/problem-matchers/detekt.json" - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 From d2f17b11930e56564289fab68a1b003c63c95737 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:12:43 +0200 Subject: [PATCH 61/74] test --- .github/problem-matchers/kotlin.json | 2 +- .github/workflows/include-static-analysis.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 30ea39ed12..2a53f65fbb 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -14,7 +14,7 @@ ] }, { - "owner": "kotlin-1.7-warning", + "owner": "kotlin-warning", "severity": "warning", "pattern": [ { diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index b88cdbbf3c..32e7e26a6b 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -88,7 +88,7 @@ jobs: run: ./gradlew detekt - name: Stash Detekt results - if: always() && !cancelled() + if: !cancelled() run: | rm -rf /tmp/detekt mkdir /tmp/detekt @@ -102,7 +102,7 @@ jobs: - name: Publish Detekt results uses: actions/upload-artifact@v4 - if: always() && !cancelled() + if: !cancelled() with: name: Detekt Analyzer report path: /tmp/detekt/* From d203cfe709ca492aaa976b9dfa1a8edaa55f779f Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:15:18 +0200 Subject: [PATCH 62/74] test --- .github/workflows/include-static-analysis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 32e7e26a6b..26ae8aa130 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -35,7 +35,6 @@ jobs: run: ./gradlew ktlintCheck - name: Stash Ktlint results - if: always() && !cancelled() run: | rm -rf /tmp/ktlint rm -rf /tmp/detekt @@ -51,7 +50,6 @@ jobs: - name: Publish Ktlint results uses: actions/upload-artifact@v4 - if: always() && !cancelled() with: name: Ktlint Analyzer report path: /tmp/ktlint/* @@ -88,7 +86,6 @@ jobs: run: ./gradlew detekt - name: Stash Detekt results - if: !cancelled() run: | rm -rf /tmp/detekt mkdir /tmp/detekt @@ -102,7 +99,6 @@ jobs: - name: Publish Detekt results uses: actions/upload-artifact@v4 - if: !cancelled() with: name: Detekt Analyzer report path: /tmp/detekt/* From 08cad820be3053b6b5fde5e029e8d3ab77a8eaf1 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:16:00 +0200 Subject: [PATCH 63/74] test --- .github/workflows/include-static-analysis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 26ae8aa130..b88cdbbf3c 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -35,6 +35,7 @@ jobs: run: ./gradlew ktlintCheck - name: Stash Ktlint results + if: always() && !cancelled() run: | rm -rf /tmp/ktlint rm -rf /tmp/detekt @@ -50,6 +51,7 @@ jobs: - name: Publish Ktlint results uses: actions/upload-artifact@v4 + if: always() && !cancelled() with: name: Ktlint Analyzer report path: /tmp/ktlint/* @@ -86,6 +88,7 @@ jobs: run: ./gradlew detekt - name: Stash Detekt results + if: always() && !cancelled() run: | rm -rf /tmp/detekt mkdir /tmp/detekt @@ -99,6 +102,7 @@ jobs: - name: Publish Detekt results uses: actions/upload-artifact@v4 + if: always() && !cancelled() with: name: Detekt Analyzer report path: /tmp/detekt/* From 9f7d993aae2d743de896131c09a281c5aea92090 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:22:27 +0200 Subject: [PATCH 64/74] test --- .github/problem-matchers/kotlin.json | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 2a53f65fbb..2ea018905c 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -5,36 +5,13 @@ "severity": "error", "pattern": [ { - "regexp": "^e\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^.*", "file": 1, "line": 2, "column": 3, "message": 4 } ] - }, - { - "owner": "kotlin-warning", - "severity": "warning", - "pattern": [ - { - "regexp": "^w\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", - "file": 1, - "line": 2, - "column": 3, - "message": 4 - } - ] - }, - { - "owner": "gradle-warning", - "severity": "warning", - "pattern": [ - { - "regexp": "^WARNING:(.*(?:\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", - "message": 1 - } - ] } ] } From a1a5911bb6aa93dfd93edc7668188a2d4effc1a2 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:23:59 +0200 Subject: [PATCH 65/74] test --- .github/problem-matchers/kotlin.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 2ea018905c..92d6d84866 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -5,11 +5,8 @@ "severity": "error", "pattern": [ { - "regexp": "^.*", - "file": 1, - "line": 2, - "column": 3, - "message": 4 + "regexp": "^(.*)", + "message": 1 } ] } From da305fe9c1e10b5d9de6d3a3bec45e9b4bfd0da8 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:27:22 +0200 Subject: [PATCH 66/74] test --- .github/problem-matchers/kotlin.json | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 92d6d84866..2a53f65fbb 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -5,7 +5,33 @@ "severity": "error", "pattern": [ { - "regexp": "^(.*)", + "regexp": "^e\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + }, + { + "owner": "kotlin-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^w\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + }, + { + "owner": "gradle-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^WARNING:(.*(?:\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", "message": 1 } ] From 9539e10480a0daa52068da2c14cbf21198f2b53c Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:49:41 +0200 Subject: [PATCH 67/74] test --- .github/problem-matchers/kotlin.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 2a53f65fbb..436ce8454b 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -5,7 +5,7 @@ "severity": "error", "pattern": [ { - "regexp": "^e\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^e\\:\\s(?:(?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\))?\\:\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", "file": 1, "line": 2, "column": 3, @@ -18,7 +18,7 @@ "severity": "warning", "pattern": [ { - "regexp": "^w\\:\\s((?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\)\\:)?\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^w\\:\\s(?:(?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\))?\\:\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", "file": 1, "line": 2, "column": 3, @@ -31,7 +31,7 @@ "severity": "warning", "pattern": [ { - "regexp": "^WARNING:(.*(?:\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^WARNING:(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", "message": 1 } ] From 1790364807e015bfc7fdef6911221c7cc9385061 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:52:41 +0200 Subject: [PATCH 68/74] revert forcing warning --- buildSrc/buildSrc/build.gradle.kts | 3 --- 1 file changed, 3 deletions(-) diff --git a/buildSrc/buildSrc/build.gradle.kts b/buildSrc/buildSrc/build.gradle.kts index 7c2d033a7c..fdf7863b64 100644 --- a/buildSrc/buildSrc/build.gradle.kts +++ b/buildSrc/buildSrc/build.gradle.kts @@ -11,6 +11,3 @@ sourceSets.main { include("Config.kt") } } - -val a: Int = "" - From c1fe0fa54fb0b9330c18d431488a5e626b7ab5cd Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 00:56:52 +0200 Subject: [PATCH 69/74] Add matchers to build steps --- .github/workflows/include-static-analysis.yml | 2 + .github/workflows/pr.yml | 60 +++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index b88cdbbf3c..aedd747f44 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -16,6 +16,7 @@ jobs: - name: Register problem matchers run: |- echo "::add-matcher::.github/problem-matchers/kotlin.json" + echo "::add-matcher::.github/problem-matchers/ktlint.json" - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 @@ -69,6 +70,7 @@ jobs: - name: Register problem matchers run: |- echo "::add-matcher::.github/problem-matchers/kotlin.json" + echo "::add-matcher::.github/problem-matchers/detekt.json" - name: Setup Gradle and task/dependency caching uses: gradle/actions/setup-gradle@v3 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3c3ce6385b..a93c53614d 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -41,6 +41,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -108,6 +112,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup build cache uses: actions/cache@v4 with: @@ -184,6 +192,10 @@ jobs: fetch-depth: 0 submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup build cache uses: actions/cache@v4 with: @@ -244,6 +256,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -330,6 +346,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -410,6 +430,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -513,6 +537,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -648,6 +676,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -717,6 +749,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -785,6 +821,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -854,6 +894,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -945,6 +989,10 @@ jobs: with: submodules: "recursive" + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' @@ -1206,6 +1254,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' @@ -1328,6 +1380,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' @@ -1462,6 +1518,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Register problem matchers + run: |- + echo "::add-matcher::.github/problem-matchers/kotlin.json" + # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' From 0c7d6228628c8b51165cfcd47dac243a10b6b083 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 01:05:15 +0200 Subject: [PATCH 70/74] test --- .github/problem-matchers/kotlin.json | 6 +++--- .github/workflows/include-static-analysis.yml | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/problem-matchers/kotlin.json b/.github/problem-matchers/kotlin.json index 436ce8454b..a5cdc3ab7c 100644 --- a/.github/problem-matchers/kotlin.json +++ b/.github/problem-matchers/kotlin.json @@ -5,7 +5,7 @@ "severity": "error", "pattern": [ { - "regexp": "^e\\:\\s(?:(?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\))?\\:\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^e\\:\\s(?:(?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\))?\\:\\s)?(.*)$", "file": 1, "line": 2, "column": 3, @@ -18,7 +18,7 @@ "severity": "warning", "pattern": [ { - "regexp": "^w\\:\\s(?:(?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\))?\\:\\s)?(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^w\\:\\s(?:(?:(.*):(?:\\s\\()?(\\d+)(?:(?:\\,\\s)|\\:)(\\d+))(?:\\))?\\:\\s)?(.*)$", "file": 1, "line": 2, "column": 3, @@ -31,7 +31,7 @@ "severity": "warning", "pattern": [ { - "regexp": "^WARNING:(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)", + "regexp": "^WARNING:(.*(?:\\n(?!w|e\\:|>|FAILURE|BUILD SUCCESSFUL).*)*)$", "message": 1 } ] diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index aedd747f44..173100d4fb 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -15,7 +15,6 @@ jobs: - name: Register problem matchers run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" echo "::add-matcher::.github/problem-matchers/ktlint.json" - name: Setup Gradle and task/dependency caching @@ -69,7 +68,6 @@ jobs: - name: Register problem matchers run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" echo "::add-matcher::.github/problem-matchers/detekt.json" - name: Setup Gradle and task/dependency caching From 08bbc8a69d4f6eacfa938e5137b370059e02928e Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 01:14:58 +0200 Subject: [PATCH 71/74] test --- .github/workflows/include-static-analysis.yml | 6 ++---- .../kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt | 2 +- .../kotlin/io/realm/kotlin/internal/platform/RealmObject.kt | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/include-static-analysis.yml b/.github/workflows/include-static-analysis.yml index 173100d4fb..e30fd81978 100644 --- a/.github/workflows/include-static-analysis.yml +++ b/.github/workflows/include-static-analysis.yml @@ -33,9 +33,9 @@ jobs: - name: Run Ktlint run: ./gradlew ktlintCheck + continue-on-error: true - name: Stash Ktlint results - if: always() && !cancelled() run: | rm -rf /tmp/ktlint rm -rf /tmp/detekt @@ -51,7 +51,6 @@ jobs: - name: Publish Ktlint results uses: actions/upload-artifact@v4 - if: always() && !cancelled() with: name: Ktlint Analyzer report path: /tmp/ktlint/* @@ -86,9 +85,9 @@ jobs: - name: Run Detekt run: ./gradlew detekt + continue-on-error: true - name: Stash Detekt results - if: always() && !cancelled() run: | rm -rf /tmp/detekt mkdir /tmp/detekt @@ -102,7 +101,6 @@ jobs: - name: Publish Detekt results uses: actions/upload-artifact@v4 - if: always() && !cancelled() with: name: Detekt Analyzer report path: /tmp/detekt/* diff --git a/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt b/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt index 20a71e3521..1c8c893da0 100644 --- a/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt +++ b/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt @@ -271,7 +271,7 @@ private fun Provider.safeProvider(): Provider = this.let { else -> it } } - +@Suppress("ComplexMethod", "NestedBlockDepth") private fun gatherTargetInfo(kotlinCompilation: KotlinCompilation<*>): TargetInfo? { val project = kotlinCompilation.target.project return when (kotlinCompilation) { diff --git a/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt b/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt index 6ab976dc12..97f948eafb 100644 --- a/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt +++ b/packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/RealmObject.kt @@ -29,8 +29,6 @@ internal actual fun realmObjectCompanionOrNull(clazz: KClass): Real clazz.companionObjectInstance as RealmObjectCompanion } else null - - @PublishedApi internal actual fun realmObjectCompanionOrThrow(clazz: KClass): RealmObjectCompanion = realmObjectCompanionOrNull(clazz) From 9f03eb768ac375befd07efd696e0c095f7643272 Mon Sep 17 00:00:00 2001 From: Clemente Date: Sat, 8 Jun 2024 01:38:02 +0200 Subject: [PATCH 72/74] test --- .github/workflows/pr.yml | 44 ---------------------------------------- 1 file changed, 44 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a93c53614d..86350d0d32 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -192,10 +192,6 @@ jobs: fetch-depth: 0 submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup build cache uses: actions/cache@v4 with: @@ -256,10 +252,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -537,10 +529,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -676,10 +664,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -749,10 +733,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -821,10 +801,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -894,10 +870,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - - name: Setup Java 11 uses: actions/setup-java@v4 with: @@ -989,10 +961,6 @@ jobs: with: submodules: "recursive" - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' @@ -1254,10 +1222,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' @@ -1380,10 +1344,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' @@ -1518,10 +1478,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/kotlin.json" - # checkout BAAS CLI repo - name: Checkout BAAS repo if: matrix.type == 'sync' From 1df43eae631dc109d6d06f8610c5ca91b5705a20 Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 10 Jun 2024 10:11:44 +0200 Subject: [PATCH 73/74] TEST --- .github/workflows/pr.yml | 12 ++++++++++++ .../kotlin/io/realm/kotlin/internal/RealmImpl.kt | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 86350d0d32..76a0f873d0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -315,6 +315,10 @@ jobs: working-directory: packages run: ./gradlew buildJVMSharedLibs -Prealm.kotlin.mainHost=false + - name: Show ccache size + run: | + echo `du -sh ~/.ccache` + - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -499,6 +503,10 @@ jobs: working-directory: packages run: ./gradlew publishCIPackages -Prealm.kotlin.targets=jvm -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.copyNativeJvmLibs=linux,windows,macos -Prealm.kotlin.mainHost=false + - name: Show ccache size + run: | + echo `du -sh ~/.ccache` + - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -706,6 +714,10 @@ jobs: working-directory: packages run: ./gradlew publishCIPackages -Prealm.kotlin.targets=macosX64 -Prealm.kotlin.mainHost=false + - name: Show ccache size + run: | + echo `du -sh ~/.ccache` + # We cannot use artifacts as they cannot be shared between workflows, so use cache instead. - name: Store build cache uses: actions/cache@v4 diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt index 463d604eea..d386f81bf7 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt @@ -106,6 +106,10 @@ public class RealmImpl private constructor( @OptIn(ExperimentalStdlibApi::class) public var syncContext: AtomicRef = atomic(null) + internal fun test(){ + + } + init { @Suppress("TooGenericExceptionCaught") // Track whether or not the file was created as part of opening the Realm. We need this From c3b733fc88a19c7314847ff4286b338518150d9b Mon Sep 17 00:00:00 2001 From: Clemente Date: Mon, 10 Jun 2024 15:05:06 +0200 Subject: [PATCH 74/74] Undo changes --- .../kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt | 1 + .../commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt b/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt index 1c8c893da0..270c67c93b 100644 --- a/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt +++ b/packages/gradle-plugin/src/main/kotlin/io/realm/kotlin/gradle/RealmCompilerSubplugin.kt @@ -271,6 +271,7 @@ private fun Provider.safeProvider(): Provider = this.let { else -> it } } + @Suppress("ComplexMethod", "NestedBlockDepth") private fun gatherTargetInfo(kotlinCompilation: KotlinCompilation<*>): TargetInfo? { val project = kotlinCompilation.target.project diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt index d386f81bf7..463d604eea 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt @@ -106,10 +106,6 @@ public class RealmImpl private constructor( @OptIn(ExperimentalStdlibApi::class) public var syncContext: AtomicRef = atomic(null) - internal fun test(){ - - } - init { @Suppress("TooGenericExceptionCaught") // Track whether or not the file was created as part of opening the Realm. We need this