forked from valhalla/valhalla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-pipelines.yml
144 lines (127 loc) · 6.17 KB
/
.azure-pipelines.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
# Azure Pipelines for Valhalla
#
# TODO: Shallow clone blocked by
# https://developercommunity.visualstudio.com/content/problem/294872/yaml-build-ignores-fetchdepth.html
# TODO: Once CMake 3.13 is available replace -H with -S option
#
# No wildcards allowed for file patterns...
# skip draft PR's, skip all commits except for PRs to master
trigger: none
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- CHANGELOG.md
- bench/
- docker/
- docs/
- run_route_scripts/
- test/
- .circleci/
- .github/
drafts: false
jobs:
- job: VS2019
displayName: 'Windows 2019 | VS2019'
timeoutInMinutes: 120
pool:
vmImage: 'windows-2019'
variables:
BUILD_CFG: 'Release'
BUILD_DIR: '$(Agent.WorkFolder)\build'
VCPKG_DIR: '$(Build.SourcesDirectory)\vcpkg'
VCPKG_REF: 'f4bd6423'
TRIPLET: 'x64'
CONAN_HOME: '$(Build.SourcesDirectory)/conan'
steps:
- script: |
git submodule update --init --recursive
echo $(Build.SourceBranch)
displayName: 'Pull submodules'
- task: Cache@2
displayName: "Cache vcpkg's packages"
inputs:
key: .\.vcpkg_deps.txt | "$(VCPKG_REF)" | "$(TRIPLET)" | ".v2"
path: "$(VCPKG_DIR)"
cacheHitVar: CACHE_RESTORED
- task: Cache@2
displayName: "Cache conan packages"
inputs:
key: '"msvc-v16.10.0" | conan | .\conanfile.txt | "$(Build.SourceBranch)" | "v2"'
path: "$(CONAN_HOME)"
cacheHitVar: BUILD_CACHE_RESTORED
# TODO: cache build never worked, look into it
# - task: Cache@2
# displayName: "Cache build"
# inputs:
# key: '"msvc-v16.10.0" | build | "$(Build.SourceBranch)"'
# path: "$(BUILD_DIR)"
# restoreKeys: |
# "msvc-v16.10.0" | build | "$(Build.SourceBranch)"
# "msvc-v16.10.0" | build
# cacheHitVar: BUILD_CACHE_RESTORED
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
architecture: "$(TRIPLET)"
- script: |
git clone https://github.com/microsoft/vcpkg %VCPKG_DIR%
git -C %VCPKG_DIR% checkout %VCPKG_REF%
echo.set(VCPKG_BUILD_TYPE release)>> %VCPKG_DIR%\triplets\%TRIPLET%-windows.cmake
call %VCPKG_DIR%\bootstrap-vcpkg.bat
%VCPKG_DIR%\vcpkg.exe version
displayName: 'Install vcpkg'
condition: ne(variables.CACHE_RESTORED, 'true')
- script: |
%VCPKG_DIR%\vcpkg.exe install --triplet %TRIPLET%-windows "@.vcpkg_deps.txt"
%VCPKG_DIR%\vcpkg.exe list
if exist %VCPKG_DIR%\downloads rmdir /S /Q %VCPKG_DIR%\downloads
if exist %VCPKG_DIR%\packages rmdir /S /Q %VCPKG_DIR%\packages
displayName: 'Install vcpkg packages'
condition: ne(variables.CACHE_RESTORED, 'true')
- script: |
move /Y third_party\OSM-binary\src\fileformat.proto third_party\OSM-binary\src\fileformat.proto.orig
move /Y third_party\OSM-binary\src\osmformat.proto third_party\OSM-binary\src\osmformat.proto.orig
echo syntax = "proto2"; > third_party\OSM-binary\src\fileformat.proto
type third_party\OSM-binary\src\fileformat.proto.orig >> third_party\OSM-binary\src\fileformat.proto
echo syntax = "proto2"; > third_party\OSM-binary\src\osmformat.proto
type third_party\OSM-binary\src\osmformat.proto.orig >> third_party\OSM-binary\src\osmformat.proto
del /Q third_party\OSM-binary\src\fileformat.proto.orig
del /Q third_party\OSM-binary\src\osmformat.proto.orig
displayName: 'Patch .proto files of OSMPBF with syntax=proto2'
- powershell: |
wget https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-win.zip -o $(Build.SourcesDirectory)\ninja_win.zip
Expand-Archive $(Build.SourcesDirectory)\ninja_win.zip -DestinationPath $(Build.SourcesDirectory)\ninja
displayName: 'Download Ninja'
- script: |
pip install conan
displayName: Install conan
- script: |
SET PATH=%PATH%;$(Build.SourcesDirectory)\ninja
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
cmake --version
cmake -G "Ninja" -H$(Build.SourcesDirectory) -B%BUILD_DIR% -DCMAKE_BUILD_TYPE=%BUILD_CFG% -DCMAKE_TOOLCHAIN_FILE=%VCPKG_DIR%\scripts\buildsystems\vcpkg.cmake -DVCPKG_APPLOCAL_DEPS=ON -DENABLE_DATA_TOOLS=ON -DENABLE_TOOLS=ON -DENABLE_PYTHON_BINDINGS=ON -DENABLE_TESTS=OFF -DENABLE_CCACHE=OFF -DENABLE_HTTP=OFF -DENABLE_SERVICES=OFF -DENABLE_BENCHMARKS=OFF -DLUA_INCLUDE_DIR=%VCPKG_DIR%\installed\%TRIPLET%-windows\include\luajit -DLUA_LIBRARIES=%VCPKG_DIR%\installed\%TRIPLET%-windows\lib\lua51.lib"
env:
CONAN_USER_HOME: $(CONAN_HOME)
displayName: 'Run CMake to configure build'
- script: |
SET PATH=%PATH%;$(Build.SourcesDirectory)\ninja
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvars64.bat"
cmake --build %BUILD_DIR% --config %BUILD_CFG%
displayName: 'Run CMake to build'
- script: |
SET PATH=%PATH%;%VCPKG_DIR%\installed\%TRIPLET%-windows\bin;%VCPKG_DIR%\installed\%TRIPLET%-windows\debug\bin
%BUILD_DIR%\valhalla_build_tiles.exe -c .\test\win\valhalla.json .\test\data\utrecht_netherlands.osm.pbf
%BUILD_DIR%\valhalla_run_route.exe --config .\test\win\valhalla.json -j "{\"locations\": [{\"lat\": 52.10205, \"lon\": 5.114651}, {\"lat\": 52.093113, \"lon\": 5.100918}], \"costing\": \"auto\"}"
%BUILD_DIR%\valhalla_run_isochrone.exe --config .\test\win\valhalla.json -j "{\"locations\": [{\"lat\": 52.10205, \"lon\": 5.114651}], \"costing\": \"auto\", \"contours\":[{\"time\":15,\"color\":\"ff0000\"}]}"
displayName: 'Test some executables'