forked from XRPLF/rippled
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
107 lines (93 loc) · 3.6 KB
/
appveyor.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
# Set environment variables.
environment:
# We bundle up only the parts of boost and openssl we need so
# that it's a small download. We also use appveyor's free cache, avoiding fees
# downloading from S3 each time.
# TODO: script to create this package.
RIPPLED_DEPS_PATH: rippled_deps17.05
RIPPLED_DEPS_BASE_URL: https://ripple.github.io/Downloads/appveyor
RIPPLED_OPENSSL: rippled_deps.openssl.1.0.2j.zip
RIPPLED_BOOST: rippled_deps.boost.1.70.zip
RIPPLED_BOOST_STAGE: rippled_deps.boost.stage.1.70.zip
# CMake honors these environment variables, setting the include/lib paths.
BOOST_ROOT: C:/%RIPPLED_DEPS_PATH%/boost
OPENSSL_ROOT: C:/%RIPPLED_DEPS_PATH%/openssl
NIH_CACHE_ROOT: C:/%RIPPLED_DEPS_PATH%/
# We've had trouble with AppVeyor apparently not having a stack as large
# as the *nix CI platforms. AppVeyor support suggested that we try
# GCE VMs. The following line is supposed to enable that VM type.
appveyor_build_worker_cloud: gce
matrix:
- build: cmake
target: msvc.debug
buildconfig: Debug
os: Visual Studio 2017
# At the end of each successful build we cache this directory.
# https://www.appveyor.com/docs/build-cache/
# Resulting archive should not exceed 100 MB.
cache:
- 'C:\%RIPPLED_DEPS_PATH%'
# This means we'll download a zip of the branch we want, rather than the full
# history.
shallow_clone: true
install:
# Download dependencies if appveyor didn't restore them from the cache.
# Use 7zip to unzip.
- ps: |
if (-not(Test-Path "C:/$env:RIPPLED_DEPS_PATH")) {
$files = @(
"$env:RIPPLED_BOOST",
"$env:RIPPLED_BOOST_STAGE",
"$env:RIPPLED_OPENSSL"
)
For ($i=0; $i -lt $files.Length; $i++) {
$file = $files[$i]
$url = "$env:RIPPLED_DEPS_BASE_URL/$file"
echo "Download $file from $url"
Start-FileDownload "$url"
7z x "$file" -o"C:\$env:RIPPLED_DEPS_PATH" -y > $null
if ($LastExitCode -ne 0) { throw "7z failed" }
}
}
else
{
"Dependencies are in cache"
ls "C:/$env:RIPPLED_DEPS_PATH"
}
# Newer DEPS include a versions file.
# Dump it so we can verify correct behavior.
- ps: |
cat "C:/$env:RIPPLED_DEPS_PATH/version*.txt"
# TODO: This is giving me grief
# artifacts:
# # Save rippled.exe in the cloud after each build.
# - path: "build\\rippled.exe"
build_script:
# We set the environment variables needed to put compilers on the PATH.
- '"%VS140COMNTOOLS%../../VC/vcvarsall.bat" x86_amd64'
# Show which version of the compiler we are using.
- cl
- ps: |
# Build with cmake
cmake --version
$cmake_target="$($env:target).ci"
"$cmake_target"
New-Item -ItemType Directory -Force -Path "build/$cmake_target"
Push-Location "build/$cmake_target"
cmake -G"Visual Studio 15 2017 Win64" ../..
if ($LastExitCode -ne 0) { throw "CMake failed" }
cmake --build . --config $env:buildconfig --parallel 3
if ($LastExitCode -ne 0) { throw "CMake build failed" }
Pop-Location
after_build:
- ps: |
$exe="build/$cmake_target/$env:buildconfig/rippled"
"Exe is at $exe"
test_script:
- ps: |
& {
# Run the rippled unit tests
& $exe --unittest --unittest-log --unittest-jobs 2
# https://connect.microsoft.com/PowerShell/feedback/details/751703/option-to-stop-script-if-command-line-exe-fails
if ($LastExitCode -ne 0) { throw "Unit tests failed" }
}