forked from datastax/csharp-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
285 lines (260 loc) · 9.9 KB
/
build.yaml
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
schedules:
commit-oss:
# Run short suite on commit
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
matrix:
exclude:
# dont build on windows (windows provisioning takes too long, run only on nightly and weekly schedules)
- os: 'win/cs'
# on linux dont build net452 and net461
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['net452', 'net461']
# on linux with netcoreapp2.1 target 2.2, 3.0 and 3.11
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['netcoreapp2.1']
cassandra: ['2.1', '4.0', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
# on linux with mono target 3.11
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['mono']
cassandra: ['2.1', '2.2', '3.0', '4.0', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
commit-dse:
# Run short suite on commit
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
matrix:
exclude:
# dont build on windows (DSE is very slow on WSL, run only on nightly and weekly schedules)
- os: 'win/cs'
# on linux dont build net452 and net461
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['net452', 'net461']
# on linux with netcoreapp2.1 target dse-5.1, dse-6.8.0 and dse-6.7
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['netcoreapp2.1']
cassandra: ['2.1', '2.2', '3.0', '3.11', '4.0', 'dse-5.0', 'dse-6.0']
# on linux with mono target dse-6.7
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['mono']
cassandra: ['2.1', '2.2', '3.0', '3.11', '4.0', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8.0']
nightly-oss-ubuntu:
# nightly job for primary branches to run almost all configs on ubuntu.
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
branches:
# regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, master, etc).
include: ["/((\\d+(\\.[\\dx]+)+)|master)/"]
matrix:
exclude:
- os: 'win/cs'
# on linux dont build net452 and net461
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['net452', 'net461']
# on linux dont build dse
- os: 'ubuntu/bionic64/csharp-driver'
cassandra: ['dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
# on linux with netcoreapp2.1 target all oss
# on linux with mono target 2.2 and 3.11
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['mono']
cassandra: ['2.1', '3.0']
nightly-dse-ubuntu:
# nightly job for primary branches to run almost all configs on ubuntu.
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
branches:
# regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, master, etc).
include: ["/((\\d+(\\.[\\dx]+)+)|master)/"]
matrix:
exclude:
- os: 'win/cs'
# on linux dont build net452 and net461
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['net452', 'net461']
# on linux dont build oss
- os: 'ubuntu/bionic64/csharp-driver'
cassandra: ['2.1', '2.2', '3.0', '3.11', '4.0']
# on linux with netcoreapp2.1 target all dse
# on linux with mono target dse-5.1 and dse-6.7
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['mono']
cassandra: ['dse-5.0', 'dse-6.0', 'dse-6.8.0']
nightly-oss-windows:
# nightly job for primary branches to run several configs on windows (windows builds are slow so it's less configs than the nightly ubuntu schedule).
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
branches:
# regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, master, etc).
include: ["/((\\d+(\\.[\\dx]+)+)|master)/"]
matrix:
exclude:
- os: 'ubuntu/bionic64/csharp-driver'
# on windows dont build mono
- os: 'win/cs'
dotnet: ['mono']
# on windows target 3.11 with netcoreapp2.1
- os: 'win/cs'
dotnet: ['netcoreapp2.1']
cassandra: ['2.1', '2.2', '3.0', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
# on windows target 2.1, 2.2 and 3.11
- os: 'win/cs'
dotnet: ['net452']
cassandra: ['3.0', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
# on windows target 2.2 and 3.11 with net461
- os: 'win/cs'
dotnet: ['net461']
cassandra: ['2.1', '3.0', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
adhoc:
# adhoc job for non-primary braches that doesn't have the nightly and weekly schedules so this may be used to run same configs as the weekly schedule.
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
branches:
exclude: ["/((\\d+(\\.[\\dx]+)+)|master)/"]
matrix:
exclude:
# on windows dont build mono
- os: 'win/cs'
dotnet: ['mono']
# on windows dont build DSE
- os: 'win/cs'
cassandra: ['dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
# on linux dont build net452 and net461
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['net452', 'net461']
# on linux target all
weekly:
schedule: adhoc
notify:
slack: csharp-driver-dev-bots
branches:
include: ["/((\\d+(\\.[\\dx]+)+)|master)/"]
matrix:
exclude:
# on windows dont build mono
- os: 'win/cs'
dotnet: ['mono']
# on windows dont build DSE
- os: 'win/cs'
cassandra: ['dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.7', 'dse-6.8.0']
# on linux dont build net452 and net461
- os: 'ubuntu/bionic64/csharp-driver'
dotnet: ['net452', 'net461']
# on linux target all
os:
- ubuntu/bionic64/csharp-driver
- win/cs
cassandra:
- '2.1'
- '2.2'
- '3.0'
- '3.11'
- '4.0'
- 'dse-5.0'
- 'dse-5.1'
- 'dse-6.0'
- 'dse-6.7'
- 'dse-6.8.0'
dotnet:
- 'mono'
- 'netcoreapp2.1'
- 'net461'
- 'net452'
build:
- batch:
script: |
powershell.exe -File .\buildps.ps1
if errorlevel 1 (
echo Failure Reason Given is %errorlevel%
exit /b %errorlevel%
)
- script: |
export CASS_VERSION_SNI='dse-6.7'
# Set the Java paths (for CCM)
export JAVA_HOME=$CCM_JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
export SIMULACRON_PATH=$HOME/simulacron.jar
if [[ $CASSANDRA_VERSION == dse-* ]] ;
then
export CCM_PATH=$HOME/ccm
export DSE_BRANCH=$CCM_BRANCH
export DSE_VERSION=$CCM_VERSION
export DSE_INITIAL_IPPREFIX="127.0.0."
export DSE_IN_REMOTE_SERVER="false"
if [ $DSE_VERSION = '6.0' ]; then
echo "Setting DSE 6.0 install-dir"
export DSE_PATH=$CCM_INSTALL_DIR
fi
echo $DSE_VERSION
echo $DSE_PATH
echo $DSE_INITIAL_IPPREFIX
echo $DSE_IN_REMOTE_SERVER
echo $DSE_INITIAL_IPPREFIX
fi
echo $CSHARP_VERSION
# Define Cassandra runtime
echo "========== Setting Server Version =========="
export CASSANDRA_VERSION_ORIGINAL=$CASSANDRA_VERSION
export CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION
echo "========== Copying ssl files to $HOME/ssl =========="
cp -r /home/jenkins/ccm/ssl $HOME/ssl
if [ $CASSANDRA_VERSION_ORIGINAL = $CASS_VERSION_SNI ]; then
export SNI_ENABLED="true"
export SINGLE_ENDPOINT_PATH="${HOME}/proxy/run.sh"
export SNI_CERTIFICATE_PATH="${HOME}/proxy/certs/client_key.pfx"
export SNI_CA_PATH="${HOME}/proxy/certs/root.crt"
fi
echo $SNI_ENABLED
echo $SINGLE_ENDPOINT_PATH
echo $SNI_CERTIFICATE_PATH
echo $SNI_CA_PATH
ls "${HOME}/proxy/"
# Download and uncompress saxon
mkdir saxon
curl -L -o saxon/saxon9he.jar https://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/9.8.0-12/Saxon-HE-9.8.0-12.jar
if [ $DOTNET_VERSION = 'mono' ]; then
echo "========== Starting Mono Build =========="
mono --version
# Define alias for Nuget
nuget() {
mono /usr/local/bin/nuget.exe "$@"
}
export -f nuget
# Install the required packages
nuget install NUnit.Runners -Version 3.6.1 -OutputDirectory testrunner
# Compile the driver and test code
msbuild /t:restore /v:m src/Cassandra.sln
msbuild /p:Configuration=Release /v:m /p:DynamicConstants=LINUX src/Cassandra.sln
# Run the tests
mono ./testrunner/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe src/Cassandra.IntegrationTests/bin/Release/net452/Cassandra.IntegrationTests.dll --where "cat != long && cat != memory" --labels=All --result:"TestResult_nunit.xml" || error=true
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_nunit.xml tools/nunit3-junit.xslt
#Fail the build if there was an error
if [ $error ]
then
exit -1
fi
else
echo "========== Starting .NET Core Build =========="
export DOTNET_CLI_TELEMETRY_OPTOUT=1
dotnet --version
# work around nuget issue
mkdir -p /tmp/NuGetScratch
chmod -R ugo+rwx /tmp/NuGetScratch
# Install the required packages
dotnet restore src
# Run the tests
dotnet test src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -v n -f $DOTNET_VERSION -c Release --filter "(TestCategory!=long)&(TestCategory!=memory)" --logger "xunit;LogFilePath=../../TestResult_xunit.xml" || error=true
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_xunit.xml tools/JUnitXml.xslt
#Fail the build if there was an error
if [ $error ]
then
exit -1
fi
fi
- xunit:
- "**/TestResult.xml"