Skip to content

[pull] master from valhalla:master #137

[pull] master from valhalla:master

[pull] master from valhalla:master #137

Workflow file for this run

name: Windows CI
on:
push:
paths-ignore:
- '*.md'
- .circleci/
- docs/
- run_route_scripts/
- test/
- test_requests/
branches:
- master
pull_request:
paths-ignore:
- '*.md'
- .circleci/
- docs/
- run_route_scripts/
- test/
- test_requests/
branches:
- master
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
BUILD_TYPE: Release
MSVC_VERSION: '2022'
VCPKG_VERSION: '8040303'
VCPKG_INSTALL_OPTIONS: --x-abi-tools-use-exact-versions
VCPKG_DISABLE_COMPILER_TRACKING: ON
jobs:
build_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# we add a custom triplet to avoid cache misses as much as possible
# https://github.com/microsoft/vcpkg/issues/26346#issuecomment-1319244766
- name: Configure vckpg
shell: bash
run: |
echo "VCPKG_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
echo "VCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}/vcpkg/custom-triplets" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_TRIPLET=custom-x64-windows" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}/vcpkg/archives" >> $GITHUB_ENV
- name: Install GNU make & awk
run: choco install gawk make
- name: Install vcpkg
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout $VCPKG_VERSION
mkdir archives
mkdir "$VCPKG_OVERLAY_TRIPLETS"
TRIPLET_FILE="$VCPKG_OVERLAY_TRIPLETS/$VCPKG_DEFAULT_TRIPLET.cmake"
cp triplets/x64-windows.cmake "$TRIPLET_FILE"
echo "set(VCPKG_BUILD_TYPE release)" >> "$TRIPLET_FILE"
echo "set(VCPKG_DISABLE_COMPILER_TRACKING $VCPKG_DISABLE_COMPILER_TRACKING)" >> "$TRIPLET_FILE"
cmd.exe /c bootstrap-vcpkg.bat
# make sure we save vcpkg packages even if build fails
# note, we don't use vcpkg "command line" mode, but "cmake manifest" mode
- name: Restore vcpkg packages
id: vcpkg-restore
uses: actions/cache/restore@v3
with:
key: vcpkg=${{ env.VCPKG_VERSION }}-msvc=${{ env.MSVC_VERSION }}-json=${{ hashFiles('vcpkg.json') }}
path: |
vcpkg/*
!vcpkg/downloads
!vcpkg/docs
!vcpkg/buildtrees
vcpkg/downloads/tools
- name: Setup Developer Command Prompt for VS
uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake
shell: bash
run: |
cmake --version
cmake -B build \
-G "Visual Studio 17 2022" \
-A x64 \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_TOOLCHAIN_FILE" \
-DVCPKG_OVERLAY_TRIPLETS="$VCPKG_OVERLAY_TRIPLETS" \
-DVCPKG_TARGET_TRIPLET="$VCPKG_DEFAULT_TRIPLET" \
-DVCPKG_INSTALL_OPTIONS="$VCPKG_INSTALL_OPTIONS" \
-DENABLE_DATA_TOOLS=ON \
-DENABLE_TOOLS=ON \
-DENABLE_PYTHON_BINDINGS=ON \
-DENABLE_HTTP=ON \
-DENABLE_TESTS=OFF \
-DENABLE_CCACHE=OFF \
-DENABLE_SERVICES=OFF \
-DPREFER_EXTERNAL_DEPS=ON \
-DENABLE_GDAL=ON
- name: Save vcpkg packages (always, to avoid redundant rebuilds)
uses: actions/cache/save@v3
with:
key: ${{ steps.vcpkg-restore.outputs.cache-primary-key }}
path: |
vcpkg/*
!vcpkg/downloads
!vcpkg/docs
!vcpkg/buildtrees
vcpkg/downloads/tools
- name: Build Valhalla
run: |
cmake --build build --config Release -- /clp:ErrorsOnly /p:BuildInParallel=true /m:4
- name: Test Executable
shell: bash
run: |
set PATH=$PATH:${{ github.workspace }}/build/vcpkg_installed/$BUILD_TYPE/bin
./build/$BUILD_TYPE/valhalla_build_tiles.exe -c ./test/win/valhalla.json ./test/data/utrecht_netherlands.osm.pbf
./build/$BUILD_TYPE/valhalla_run_isochrone.exe --config ./test/win/valhalla.json -j "{\"locations\": [{\"lat\": 52.10205, \"lon\": 5.114651}], \"costing\": \"auto\", \"contours\":[{\"time\":15,\"color\":\"ff0000\"}]}"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
# only run this if manually invoked or a previous job failed
if: ${{ (github.event_name == 'workflow_dispatch' && inputs.debug_enabled) || failure() }}
with:
detached: true