forked from datastax/csharp-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
65 lines (54 loc) · 2.3 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
os:
- ubuntu/bionic64/csharp-driver
cassandra:
- 2.1
- 2.2
- 3.0
- '3.11'
env:
CSHARP_VERSION:
- mono
- netcore
build:
- script: |
# Set the Java paths (for CCM)
export JAVA_HOME=$CCM_JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
export SIMULACRON_PATH=$HOME/simulacron.jar
# Define Cassandra runtime
echo "========== Setting Apache Cassandra Version =========="
export CASSANDRA_VERSION=$CCM_CASSANDRA_VERSION
echo "========== Copying ssl files to $HOME/ssl =========="
cp -r /home/jenkins/ccm/ssl $HOME/ssl
# Download and uncompress saxon
mkdir saxon
curl -L -o saxon/SaxonHE9-8-0-12J.zip https://downloads.sourceforge.net/project/saxon/Saxon-HE/9.8/SaxonHE9-8-0-12J.zip
unzip saxon/SaxonHE9-8-0-12J.zip -d saxon
if [ $CSHARP_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=short --labels=All --result:"TestResult_nunit3.xml"
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_nunit3.xml tools/nunit3-xunit.xslt
else
echo "========== Starting .NET Core SDK Build =========="
export DOTNET_CLI_TELEMETRY_OPTOUT=1
dotnet --version
# Install the required packages
dotnet restore src
# Run the tests
dotnet test src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -f netcoreapp2.0 -c Release --filter TestCategory=short --logger "trx;LogFileName=../../../TestResult_trx.xml"
java -jar saxon/saxon9he.jar -o:TestResult.xml TestResult_trx.xml tools/trx-to-junit.xslt
fi
- xunit:
- "TestResult.xml"