-
Notifications
You must be signed in to change notification settings - Fork 18
208 lines (187 loc) · 6.16 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
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@30bd9ead57756016f2e2ac7630433cf0883d1bae
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-linux-sync
steps:
- uses: realm/ci-actions/mdb-realm/cleanup@30bd9ead57756016f2e2ac7630433cf0883d1bae
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-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/[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: Test
working-directory: .build/cmake-preset-linux/tests/${{ matrix.configuration }}/
run: ./cpprealm_sync_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-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: Test
# working-directory: .build/cmake-preset-windows-x64/tests/${{ matrix.configuration }}/
# run: ./cpprealm_sync_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:
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