From 06b4101b4efa243a167c7603fe2f1f540c507b30 Mon Sep 17 00:00:00 2001 From: Lee Maguire Date: Thu, 21 Mar 2024 14:30:04 +0000 Subject: [PATCH] RCPP-41 PR cleanup --- .github/workflows/check-pr-title.yml | 2 +- .github/workflows/cmake.yml | 1000 +++++++++++++------------- .github/workflows/swiftpm.yml | 162 ++--- .gitignore | 3 +- Android.bp | 1 - Package.swift | 1 - 6 files changed, 583 insertions(+), 586 deletions(-) diff --git a/.github/workflows/check-pr-title.yml b/.github/workflows/check-pr-title.yml index 32640b96..1842f5bf 100644 --- a/.github/workflows/check-pr-title.yml +++ b/.github/workflows/check-pr-title.yml @@ -19,4 +19,4 @@ jobs: with: regex: R[A-Z]{2,6}-[0-9]{1,6} error-hint: Invalid PR title. Make sure it's prefixed with the JIRA ticket the PR addresses or add the no-jira-ticket label. - ignore-labels: 'no-jira-ticket' + ignore-labels: 'no-jira-ticket' \ No newline at end of file diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index fc84e8af..482be71c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,500 +1,500 @@ -#name: CMake Build -# -#env: -# REALM_ATLAS_ENDPOINT: ${{ secrets.ATLAS_QA_BASE_URL }} -# REALM_BAAS_ENDPOINT: ${{ secrets.APPSERVICES_QA_BASE_URL }} -# REALM_ATLAS_API_KEY: ${{ secrets.ATLAS_QA_API_KEY }} -# REALM_ATLAS_PRIVATE_API_KEY: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }} -# REALM_ATLAS_PROJECT_ID: ${{ secrets.ATLAS_QA_PROJECT_ID}} -# REALM_CI: true -# REALM_DISABLE_ANALYTICS: true -#on: -# push: -# branches: -# - main -# pull_request: -# -#jobs: -# deploy-cluster: -# runs-on: ubuntu-latest -# name: Deploy Cluster -# outputs: -# clusterName: ${{ steps.deploy-cluster.outputs.clusterName }} -# steps: -# - uses: realm/ci-actions/mdb-realm/deploy@28a12a22e135d56db2b678fbe6479c0e1b52f169 -# id: deploy-cluster -# with: -# atlasUrl: ${{ env.REALM_ATLAS_ENDPOINT }} -# realmUrl: ${{ env.REALM_BAAS_ENDPOINT }} -# projectId: ${{ env.REALM_ATLAS_PROJECT_ID }} -# apiKey: ${{ env.REALM_ATLAS_API_KEY }} -# privateApiKey: ${{ env.REALM_ATLAS_PRIVATE_API_KEY }} -# -# delete-cluster: -# runs-on: ubuntu-latest -# name: Delete Cluster -# if: always() -# needs: -# - build-macos-sync -# - build-linux-sync -# - build-windows-sync -# steps: -# - uses: realm/ci-actions/mdb-realm/cleanup@28a12a22e135d56db2b678fbe6479c0e1b52f169 -# with: -# atlasUrl: ${{ env.REALM_ATLAS_ENDPOINT }} -# realmUrl: ${{ env.REALM_BAAS_ENDPOINT }} -# projectId: ${{ env.REALM_ATLAS_PROJECT_ID }} -# apiKey: ${{ env.REALM_ATLAS_API_KEY }} -# privateApiKey: ${{ env.REALM_ATLAS_PRIVATE_API_KEY }} -# -# -# build-macos-xcode13_1: -# runs-on: macos-12 -# name: macOS ${{ matrix.configuration }} (preset ${{ matrix.preset }}, Xcode ${{ matrix.xcode }}) -# strategy: -# fail-fast: false -# matrix: -# preset: -# - default -# - macos -# xcode: -# - '13.1' -# configuration: -# - Debug -# - Release -# exclude: -# - configuration: ${{ (github.event_name == 'pull_request' && 'Release') || 'none' }} -# needs: -# - deploy-cluster -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - name: Setup Ccache -# uses: hendrikmuhs/ccache-action@v1.1 -# with: -# key: ccache-macos-${{ matrix.preset }}-${{ matrix.xcode }} -# -# - name: Setup Ninja -# uses: seanmiddleditch/gha-setup-ninja@master -# -# - name: Setup Xcode -# uses: maxim-lobanov/setup-xcode@v1 -# with: -# xcode-version: ${{ matrix.xcode }} -# -# - uses: ammaraskar/gcc-problem-matcher@master -# -# - name: Configure -# run: cmake --preset ${{ matrix.preset }} -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} -# -# - name: Compile -# run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.configuration }} -# -# - name: Test -# working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_db_tests -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v3 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# build-macos-xcode15: -# runs-on: macos-13 -# name: macOS ${{ matrix.configuration }} (preset ${{ matrix.preset }}, Xcode ${{ matrix.xcode }}) -# strategy: -# fail-fast: false -# matrix: -# preset: -# - default -# - macos -# xcode: -# - '15.0' -# configuration: -# - Debug -# - Release -# exclude: -# - configuration: ${{ (github.event_name == 'pull_request' && 'Release') || 'none' }} -# needs: -# - deploy-cluster -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - name: Setup Ccache -# uses: hendrikmuhs/ccache-action@v1.1 -# with: -# key: ccache-macos-${{ matrix.preset }}-${{ matrix.xcode }} -# -# - name: Setup Ninja -# uses: seanmiddleditch/gha-setup-ninja@master -# -# - name: Setup Xcode -# uses: maxim-lobanov/setup-xcode@v1 -# with: -# xcode-version: ${{ matrix.xcode }} -# -# - uses: ammaraskar/gcc-problem-matcher@master -# -# - name: Configure -# run: cmake --preset ${{ matrix.preset }} -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} -# -# - name: Compile -# run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.configuration }} -# -# - name: Test -# working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_db_tests -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v3 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# build-macos-sync: -# runs-on: macos-13 -# name: macOS Sync ${{ matrix.configuration }} (preset ${{ matrix.preset }}, Xcode ${{ matrix.xcode }}) -# strategy: -# fail-fast: false -# matrix: -# preset: -# - default -# - macos -# xcode: -# - '15.0' -# configuration: -# - Debug -# - Release -# exclude: -# - configuration: ${{ (github.event_name == 'pull_request' && 'Release') || 'none' }} -# needs: -# - deploy-cluster -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - name: Setup Ccache -# uses: hendrikmuhs/ccache-action@v1.1 -# with: -# key: ccache-macos-${{ matrix.preset }}-${{ matrix.xcode }} -# -# - name: Setup Ninja -# uses: seanmiddleditch/gha-setup-ninja@master -# -# - name: Setup Xcode -# uses: maxim-lobanov/setup-xcode@v1 -# with: -# xcode-version: ${{ matrix.xcode }} -# -# - uses: ammaraskar/gcc-problem-matcher@master -# -# - name: Configure -# run: cmake --preset ${{ matrix.preset }} -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} -# -# - name: Compile -# run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.configuration }} -# -# - name: Flexible Sync Tests -# working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_sync_tests "~client_reset" -# -# - name: Client Reset Tests -# working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_sync_tests "client_reset" -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v3 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# build-linux: -# runs-on: ubuntu-latest -# name: Linux ${{ matrix.configuration }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }}) -# strategy: -# fail-fast: false -# matrix: -# compiler: -# - name: gcc -# version: "8.3" -# - name: gcc -# version: "9.1" -# - name: gcc -# version: "10.1" -# - name: gcc -# version: "11.1" -# - name: gcc -# version: "12.1" -# - name: clang -# version: 15 -# configuration: -# - Debug -# - Release -# needs: -# - deploy-cluster -# container: -# image: ${{ matrix.compiler.name == 'clang' && 'silkeh/clang' || matrix.compiler.name }}:${{ matrix.compiler.version }} -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Install Linux Dependencies -# run: | -# apt-get update -# apt-get install -y \ -# git \ -# libcurl4-openssl-dev \ -# libssl-dev \ -# libuv1-dev \ -# ninja-build \ -# sudo \ -# zlib1g-dev -# -# - name: Setup Ccache -# uses: hendrikmuhs/ccache-action@v1.1 -# with: -# key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }} -# -# - name: Setup CMake -# uses: jwlawson/actions-setup-cmake@v1.13 -# with: -# cmake-version: latest -# -# - uses: ammaraskar/gcc-problem-matcher@master -# -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - name: Configure -# run: cmake --preset linux -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} -# -# - name: Compile -# run: cmake --build --preset linux --config ${{ matrix.configuration }} -# -# - name: Test -# working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_db_tests -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v4 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# build-linux-sync: -# runs-on: ubuntu-20.04 -# name: Linux Sync ${{ matrix.configuration }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }}) -# strategy: -# fail-fast: false -# matrix: -# compiler: -# - name: gcc -# version: 8 -# configuration: -# - Debug -# - Release -# needs: -# - deploy-cluster -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - name: Setup Ccache -# uses: hendrikmuhs/ccache-action@v1.1 -# with: -# key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }} -# -# - name: Install Linux Dependencies -# run: | -# sudo apt-get update -# sudo apt-get install -y \ -# libcurl4-openssl-dev \ -# libssl-dev \ -# libuv1-dev \ -# ninja-build \ -# zlib1g-dev \ -# ${{ matrix.compiler.name }}-${{ matrix.compiler.version }} -# -# - name: Setup GCC ${{ matrix.compiler.version }} -# if: matrix.compiler.name == 'gcc' -# run: | -# sudo apt-get update -# sudo apt-get install -y g++-${{ matrix.compiler.version }} -# sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${{ matrix.compiler.version }} 100 -# sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${{ matrix.compiler.version }} 100 -# -# - uses: ammaraskar/gcc-problem-matcher@master -# -# - name: Configure -# run: cmake --preset linux -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} -# -# - name: Compile -# run: cmake --build --preset linux --config ${{ matrix.configuration }} -# -# - name: Flexible Sync Tests -# working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_sync_tests "~client_reset" -# -# - name: Client Reset Tests -# working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_sync_tests "client_reset" -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v3 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# build-windows: -# runs-on: windows-2022 -# name: Windows ${{ matrix.configuration }} -# strategy: -# fail-fast: false -# matrix: -# configuration: -# - Debug -# - Release -# needs: -# - deploy-cluster -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - uses: ammaraskar/msvc-problem-matcher@master -# -# - name: Configure -# run: cmake --preset windows-x64 -# -# - name: Compile -# run: cmake --build --preset windows-x64 --config ${{ matrix.configuration }} -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# - name: Test -# working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_db_tests -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v3 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true -# -# build-windows-sync: -# runs-on: windows-2022 -# name: Windows Sync ${{ matrix.configuration }} -# strategy: -# fail-fast: false -# matrix: -# configuration: -# - Debug -# - Release -# needs: -# - deploy-cluster -# env: -# REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# submodules: 'recursive' -# -# - uses: ammaraskar/msvc-problem-matcher@master -# -# - name: Configure -# run: cmake --preset windows-x64 -# -# - name: Compile -# run: cmake --build --preset windows-x64 --config ${{ matrix.configuration }} -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 -# -# - name: Flexible Sync Tests -# working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_sync_tests "~client_reset" -# -# - name: Client Reset Tests -# working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/ -# run: ./cpprealm_sync_tests "client_reset" -# -# - name: Publish Test Report -# uses: mikepenz/action-junit-report@v3 -# if: always() -# with: -# report_paths: '.build/**/TestResults.xml' -# annotate_only: true -# require_tests: true \ No newline at end of file +name: CMake Build + +env: + REALM_ATLAS_ENDPOINT: ${{ secrets.ATLAS_QA_BASE_URL }} + REALM_BAAS_ENDPOINT: ${{ secrets.APPSERVICES_QA_BASE_URL }} + REALM_ATLAS_API_KEY: ${{ secrets.ATLAS_QA_API_KEY }} + REALM_ATLAS_PRIVATE_API_KEY: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }} + REALM_ATLAS_PROJECT_ID: ${{ secrets.ATLAS_QA_PROJECT_ID}} + REALM_CI: true + REALM_DISABLE_ANALYTICS: true +on: + push: + branches: + - main + pull_request: + +jobs: + deploy-cluster: + runs-on: ubuntu-latest + name: Deploy Cluster + outputs: + clusterName: ${{ steps.deploy-cluster.outputs.clusterName }} + steps: + - uses: realm/ci-actions/mdb-realm/deploy@28a12a22e135d56db2b678fbe6479c0e1b52f169 + id: deploy-cluster + with: + atlasUrl: ${{ env.REALM_ATLAS_ENDPOINT }} + realmUrl: ${{ env.REALM_BAAS_ENDPOINT }} + projectId: ${{ env.REALM_ATLAS_PROJECT_ID }} + apiKey: ${{ env.REALM_ATLAS_API_KEY }} + privateApiKey: ${{ env.REALM_ATLAS_PRIVATE_API_KEY }} + + delete-cluster: + runs-on: ubuntu-latest + name: Delete Cluster + if: always() + needs: + - build-macos-sync + - build-linux-sync + - build-windows-sync + steps: + - uses: realm/ci-actions/mdb-realm/cleanup@28a12a22e135d56db2b678fbe6479c0e1b52f169 + with: + atlasUrl: ${{ env.REALM_ATLAS_ENDPOINT }} + realmUrl: ${{ env.REALM_BAAS_ENDPOINT }} + projectId: ${{ env.REALM_ATLAS_PROJECT_ID }} + apiKey: ${{ env.REALM_ATLAS_API_KEY }} + privateApiKey: ${{ env.REALM_ATLAS_PRIVATE_API_KEY }} + + + build-macos-xcode13_1: + runs-on: macos-12 + name: macOS ${{ matrix.configuration }} (preset ${{ matrix.preset }}, Xcode ${{ matrix.xcode }}) + strategy: + fail-fast: false + matrix: + preset: + - default + - macos + xcode: + - '13.1' + configuration: + - Debug + - Release + exclude: + - configuration: ${{ (github.event_name == 'pull_request' && 'Release') || 'none' }} + needs: + - deploy-cluster + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@v1.1 + with: + key: ccache-macos-${{ matrix.preset }}-${{ matrix.xcode }} + + - name: Setup Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode }} + + - uses: ammaraskar/gcc-problem-matcher@master + + - name: Configure + run: cmake --preset ${{ matrix.preset }} -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} + + - name: Compile + run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.configuration }} + + - name: Test + working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ + run: ./cpprealm_db_tests + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + build-macos-xcode15: + runs-on: macos-13 + name: macOS ${{ matrix.configuration }} (preset ${{ matrix.preset }}, Xcode ${{ matrix.xcode }}) + strategy: + fail-fast: false + matrix: + preset: + - default + - macos + xcode: + - '15.0' + configuration: + - Debug + - Release + exclude: + - configuration: ${{ (github.event_name == 'pull_request' && 'Release') || 'none' }} + needs: + - deploy-cluster + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@v1.1 + with: + key: ccache-macos-${{ matrix.preset }}-${{ matrix.xcode }} + + - name: Setup Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode }} + + - uses: ammaraskar/gcc-problem-matcher@master + + - name: Configure + run: cmake --preset ${{ matrix.preset }} -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} + + - name: Compile + run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.configuration }} + + - name: Test + working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ + run: ./cpprealm_db_tests + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + build-macos-sync: + runs-on: macos-13 + name: macOS Sync ${{ matrix.configuration }} (preset ${{ matrix.preset }}, Xcode ${{ matrix.xcode }}) + strategy: + fail-fast: false + matrix: + preset: + - default + - macos + xcode: + - '15.0' + configuration: + - Debug + - Release + exclude: + - configuration: ${{ (github.event_name == 'pull_request' && 'Release') || 'none' }} + needs: + - deploy-cluster + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@v1.1 + with: + key: ccache-macos-${{ matrix.preset }}-${{ matrix.xcode }} + + - name: Setup Ninja + uses: seanmiddleditch/gha-setup-ninja@master + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode }} + + - uses: ammaraskar/gcc-problem-matcher@master + + - name: Configure + run: cmake --preset ${{ matrix.preset }} -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} + + - name: Compile + run: cmake --build --preset ${{ matrix.preset }} --config ${{ matrix.configuration }} + + - name: Flexible Sync Tests + working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ + run: ./cpprealm_sync_tests "~client_reset" + + - name: Client Reset Tests + working-directory: .build/cmake-preset-${{ matrix.preset }}/tests/${{ matrix.configuration }}/ + run: ./cpprealm_sync_tests "client_reset" + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + build-linux: + runs-on: ubuntu-latest + name: Linux ${{ matrix.configuration }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }}) + strategy: + fail-fast: false + matrix: + compiler: + - name: gcc + version: "8.3" + - name: gcc + version: "9.1" + - name: gcc + version: "10.1" + - name: gcc + version: "11.1" + - name: gcc + version: "12.1" + - name: clang + version: 15 + configuration: + - Debug + - Release + needs: + - deploy-cluster + container: + image: ${{ matrix.compiler.name == 'clang' && 'silkeh/clang' || matrix.compiler.name }}:${{ matrix.compiler.version }} + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Install Linux Dependencies + run: | + apt-get update + apt-get install -y \ + git \ + libcurl4-openssl-dev \ + libssl-dev \ + libuv1-dev \ + ninja-build \ + sudo \ + zlib1g-dev + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@v1.1 + with: + key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }} + + - name: Setup CMake + uses: jwlawson/actions-setup-cmake@v1.13 + with: + cmake-version: latest + + - uses: ammaraskar/gcc-problem-matcher@master + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Configure + run: cmake --preset linux -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} + + - name: Compile + run: cmake --build --preset linux --config ${{ matrix.configuration }} + + - name: Test + working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ + run: ./cpprealm_db_tests + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v4 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + build-linux-sync: + runs-on: ubuntu-20.04 + name: Linux Sync ${{ matrix.configuration }} (${{ matrix.compiler.name }} ${{ matrix.compiler.version }}) + strategy: + fail-fast: false + matrix: + compiler: + - name: gcc + version: 8 + configuration: + - Debug + - Release + needs: + - deploy-cluster + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Setup Ccache + uses: hendrikmuhs/ccache-action@v1.1 + with: + key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }} + + - name: Install Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + libcurl4-openssl-dev \ + libssl-dev \ + libuv1-dev \ + ninja-build \ + zlib1g-dev \ + ${{ matrix.compiler.name }}-${{ matrix.compiler.version }} + + - name: Setup GCC ${{ matrix.compiler.version }} + if: matrix.compiler.name == 'gcc' + run: | + sudo apt-get update + sudo apt-get install -y g++-${{ matrix.compiler.version }} + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${{ matrix.compiler.version }} 100 + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${{ matrix.compiler.version }} 100 + + - uses: ammaraskar/gcc-problem-matcher@master + + - name: Configure + run: cmake --preset linux -DCMAKE_VERBOSE_MAKEFILE=${RUNNER_DEBUG:-OFF} + + - name: Compile + run: cmake --build --preset linux --config ${{ matrix.configuration }} + + - name: Flexible Sync Tests + working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ + run: ./cpprealm_sync_tests "~client_reset" + + - name: Client Reset Tests + working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ + run: ./cpprealm_sync_tests "client_reset" + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + build-windows: + runs-on: windows-2022 + name: Windows ${{ matrix.configuration }} + strategy: + fail-fast: false + matrix: + configuration: + - Debug + - Release + needs: + - deploy-cluster + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - uses: ammaraskar/msvc-problem-matcher@master + + - name: Configure + run: cmake --preset windows-x64 + + - name: Compile + run: cmake --build --preset windows-x64 --config ${{ matrix.configuration }} + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + - name: Test + working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/ + run: ./cpprealm_db_tests + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true + + build-windows-sync: + runs-on: windows-2022 + name: Windows Sync ${{ matrix.configuration }} + strategy: + fail-fast: false + matrix: + configuration: + - Debug + - Release + needs: + - deploy-cluster + env: + REALM_ATLAS_CLUSTER_NAME: ${{ needs.deploy-cluster.outputs.clusterName }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - uses: ammaraskar/msvc-problem-matcher@master + + - name: Configure + run: cmake --preset windows-x64 + + - name: Compile + run: cmake --build --preset windows-x64 --config ${{ matrix.configuration }} + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 + + - name: Flexible Sync Tests + working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/ + run: ./cpprealm_sync_tests "~client_reset" + + - name: Client Reset Tests + working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/ + run: ./cpprealm_sync_tests "client_reset" + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() + with: + report_paths: '.build/**/TestResults.xml' + annotate_only: true + require_tests: true \ No newline at end of file diff --git a/.github/workflows/swiftpm.yml b/.github/workflows/swiftpm.yml index bfab2780..776a804d 100644 --- a/.github/workflows/swiftpm.yml +++ b/.github/workflows/swiftpm.yml @@ -1,81 +1,81 @@ -#name: SwiftPM Build -# -#env: -# REALM_CI: true -# REALM_DISABLE_ANALYTICS: true -# -#on: -# push: -# branches: -# - main -# pull_request: -# -#jobs: -# build: -# runs-on: macos-13 -# name: ${{ matrix.platform }} ${{ matrix.configuration }}, Xcode ${{ matrix.xcode }} -# strategy: -# fail-fast: false -# max-parallel: 6 -# matrix: -# platform: -# - macOS -# - macOS,variant=Mac Catalyst -# - iOS -# - iOS Simulator -# - tvOS -# - tvOS Simulator -# xcode: -# - '15.0' -# configuration: -# - Debug -# - Release -# exclude: -# - configuration: ${{ github.event_name == 'pull_request' && 'Debug' || 'none' }} -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# # git-restore-mtime-bare uses the ref log to find the correct timestamp -# # for each file. This requires a full git history. The default value (1) -# # creates a shallow checkout. -# fetch-depth: 0 -# submodules: 'recursive' -# # Restore timestamps so that DerivedData caching can work across runs -# - name: Restore timestamps -# uses: chetan/git-restore-mtime-action@v1 -# -# - name: Setup Xcode -# uses: maxim-lobanov/setup-xcode@v1 -# with: -# xcode-version: ${{ matrix.xcode }} -# -# - uses: ammaraskar/gcc-problem-matcher@master -# -# - name: Compute cache key -# id: platform-escaped -# shell: pwsh -# run: echo "::set-output name=value::$([uri]::EscapeDataString('${{ matrix.platform }}'))" -# -# - name: Cache Derived Data -# uses: actions/cache@v2 -# with: -# path: .build/derivedData -# key: swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache-${{ github.sha }} -# restore-keys: | -# swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache- -# -# # https://stackoverflow.com/questions/53753511/is-it-possible-to-copy-an-xcode-derived-data-cache -# - name: Avoid inode changes for DerivedData -# run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES -# -# - name: Build -# run: | -# scheme=realm-tests -# xcodebuild -scheme $scheme -destination "generic/platform=${{ matrix.platform }}" -configuration ${{ matrix.configuration }} -derivedDataPath .build/derivedData -# -# - name: Open a tmate debug session -# if: ${{ failure() && runner.debug }} -# uses: mxschmitt/action-tmate@v3 -# with: -# timeout-minutes: 15 +name: SwiftPM Build + +env: + REALM_CI: true + REALM_DISABLE_ANALYTICS: true + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: macos-13 + name: ${{ matrix.platform }} ${{ matrix.configuration }}, Xcode ${{ matrix.xcode }} + strategy: + fail-fast: false + max-parallel: 6 + matrix: + platform: + - macOS + - macOS,variant=Mac Catalyst + - iOS + - iOS Simulator + - tvOS + - tvOS Simulator + xcode: + - '15.0' + configuration: + - Debug + - Release + exclude: + - configuration: ${{ github.event_name == 'pull_request' && 'Debug' || 'none' }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + # git-restore-mtime-bare uses the ref log to find the correct timestamp + # for each file. This requires a full git history. The default value (1) + # creates a shallow checkout. + fetch-depth: 0 + submodules: 'recursive' + # Restore timestamps so that DerivedData caching can work across runs + - name: Restore timestamps + uses: chetan/git-restore-mtime-action@v1 + + - name: Setup Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode }} + + - uses: ammaraskar/gcc-problem-matcher@master + + - name: Compute cache key + id: platform-escaped + shell: pwsh + run: echo "::set-output name=value::$([uri]::EscapeDataString('${{ matrix.platform }}'))" + + - name: Cache Derived Data + uses: actions/cache@v2 + with: + path: .build/derivedData + key: swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache-${{ github.sha }} + restore-keys: | + swiftpm-derivedData-${{ steps.platform-escaped.outputs.value }}-${{ matrix.configuration }}-xcode-${{ matrix.xcode }}-derivedData-cache- + + # https://stackoverflow.com/questions/53753511/is-it-possible-to-copy-an-xcode-derived-data-cache + - name: Avoid inode changes for DerivedData + run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES + + - name: Build + run: | + scheme=realm-tests + xcodebuild -scheme $scheme -destination "generic/platform=${{ matrix.platform }}" -configuration ${{ matrix.configuration }} -derivedDataPath .build/derivedData + + - name: Open a tmate debug session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 15 diff --git a/.gitignore b/.gitignore index 2276df4f..564290bf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,4 @@ Package.resolved # Qt demo apps examples/*.pro.user docs/html -docs/latex -src/cpprealm/config.h \ No newline at end of file +docs/latex \ No newline at end of file diff --git a/Android.bp b/Android.bp index ab67a1b0..cce5aedd 100644 --- a/Android.bp +++ b/Android.bp @@ -28,7 +28,6 @@ genrule { cc_defaults { name: "realm_cpp_defaults", cppflags: [ - "-DCPPREALM_NO_CONFIG" "-Wno-delete-non-abstract-non-virtual-dtor", "-Wno-mismatched-tags", "-Wno-unused-parameter", diff --git a/Package.swift b/Package.swift index 1577d0c1..9d177325 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,6 @@ var cxxSettings: [CXXSetting] = [ .define("REALM_DEBUG", .when(configuration: .debug)), .define("REALM_NO_CONFIG"), - .define("CPPREALM_NO_CONFIG"), .define("REALM_INSTALL_LIBEXECDIR", to: ""), .define("REALM_ENABLE_ASSERTIONS", to: "1"), .define("REALM_ENABLE_ENCRYPTION", to: "1"),