Try fix static initialisation on Windows #1013
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CMake Build | |
env: | |
APIKEY: ${{ secrets.REALM_BAASAAS_API_KEY }} | |
REALM_CI: true | |
REALM_DISABLE_ANALYTICS: true | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
stop-all-containers: | |
runs-on: ubuntu-latest | |
name: Stop Stray Containers | |
if: always() | |
needs: | |
- build-macos-sync | |
- build-linux-sync | |
- build-windows-sync | |
steps: | |
- name: Stop containers | |
run: | | |
export JSON_HEADER="Content-Type: application/json" | |
export AUTH_HEADER="apiKey: $APIKEY" | |
export BASE_URL="https://us-east-1.aws.data.mongodb-api.com/app/baas-container-service-autzb/endpoint" | |
curl --silent -X GET -H "$JSON_HEADER" -H "$AUTH_HEADER" "$BASE_URL/listContainers?mine=true" | jq | grep '"id":' | awk -F '"' '{print $4}' | while read id; do | |
curl --silent -X POST -H "$JSON_HEADER" -H "$AUTH_HEADER" "$BASE_URL/stopContainer?id=$id" | |
done | |
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' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Ccache | |
uses: hendrikmuhs/[email protected] | |
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' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Ccache | |
uses: hendrikmuhs/[email protected] | |
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' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Ccache | |
uses: hendrikmuhs/[email protected] | |
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 | |
container: | |
image: ${{ matrix.compiler.name == 'clang' && 'silkeh/clang' || matrix.compiler.name }}:${{ matrix.compiler.version }} | |
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 \ | |
valgrind | |
- name: Setup Ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: ccache-linux-${{ matrix.compiler.name }}-${{ matrix.compiler.version }} | |
- name: Setup CMake | |
uses: jwlawson/[email protected] | |
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: Valgrind leak check | |
if: ${{ matrix.compiler.name == 'gcc' && matrix.compiler.version == '12.1' }} | |
working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/ | |
run: valgrind --tool=memcheck --leak-check=full --show-leak-kinds=definite --undef-value-errors=yes --track-origins=yes --child-silent-after-fork=no --trace-children=yes --error-exitcode=1 ./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 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Setup Ccache | |
uses: hendrikmuhs/[email protected] | |
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 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- uses: ammaraskar/msvc-problem-matcher@master | |
- name: Configure | |
run: cmake --preset windows-x64 -DENABLE_STATIC=1 | |
- 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 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- uses: ammaraskar/msvc-problem-matcher@master | |
- name: Configure | |
run: cmake --preset windows-x64 -DENABLE_STATIC=1 | |
- 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 |