forked from valhalla/valhalla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-pipelines.yml
109 lines (97 loc) · 4.51 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
# 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:
branches:
include:
- master
pr:
branches:
include:
- master
paths:
exclude:
- README.md
- CHANGELOG.md
- bench/
- docs/
- run_route_scripts/
- test/
- .circleci/
- .github/
drafts: false
jobs:
- job: VS2022
displayName: 'Windows 2022 | VS2022'
timeoutInMinutes: 120
pool:
vmImage: 'windows-2022'
variables:
BUILD_CFG: 'Release'
BUILD_DIR: '$(Agent.WorkFolder)\build'
VCPKG_DIR: '$(Build.SourcesDirectory)\vcpkg'
VCPKG_ROOT: '$(Build.SourcesDirectory)\vcpkg'
VCPKG_INSTALLATION_ROOT: '$(Build.SourcesDirectory)\vcpkg'
TRIPLET: 'x64'
VCPKG_REF: 'f330a32'
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.json | "$(VCPKG_REF)" | ".v2"
path: "$(VCPKG_DIR)"
cacheHitVar: 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
- 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
%VCPKG_DIR%\vcpkg.exe list
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'
- script: |
cmake --version
cmake -G "Visual Studio 17 2022" -A %TRIPLET% -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
cmake --build %BUILD_DIR% --config %BUILD_CFG% -- /clp:ErrorsOnly /p:BuildInParallel=true /m:4
displayName: 'Build Valhalla'
- script: |
SET PATH=%PATH%;%BUILD_DIR%\vcpkg_installed\%TRIPLET%-windows\bin
%BUILD_DIR%\%BUILD_CFG%\valhalla_build_tiles.exe -c .\test\win\valhalla.json .\test\data\utrecht_netherlands.osm.pbf
%BUILD_DIR%\%BUILD_CFG%\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%\%BUILD_CFG%\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'