Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiFedartsou committed Jun 8, 2024
1 parent 70e7568 commit c0a2212
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 30 deletions.
62 changes: 33 additions & 29 deletions .github/workflows/osrm-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ jobs:
echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV
- run: npm install --ignore-scripts
- run: npm link --ignore-scripts
- uses: microsoft/setup-msbuild@v2
- name: Build
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON ..
cmake --build . --config Release
.\scripts\ci\windows-build.bat
# - name: Build
# shell: bash
# run: |
# mkdir build
# cd build
# cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON ..
# cmake --build . --config Release

# TODO: MSVC goes out of memory when building our tests
# - name: Run tests
Expand All @@ -61,33 +65,33 @@ jobs:
# cd build
# cmake --build . --config Release --target tests
# # TODO: run tests
- name: Debig
shell: bash
run:
ls -R build
- name: Run node tests
shell: bash
run: |
# prepare data
# pushd build
# cp ../test/data/monaco.osm.pbf .
# Release/osrm-extract.exe -p ../profiles/car.lua monaco.osm.pbf
# mkdir ch
# cp ./monaco.osrm* ch/
# Release/osrm-contract.exe ch/monaco.osrm
# cp -rf ch/* ../test/data/ch/
# popd
./lib/binding/osrm-extract.exe --help
# - name: Debig
# shell: bash
# run:
# ls -R build
# - name: Run node tests
# shell: bash
# run: |
# # prepare data
# # pushd build
# # cp ../test/data/monaco.osm.pbf .
# # Release/osrm-extract.exe -p ../profiles/car.lua monaco.osm.pbf

# # mkdir ch
# # cp ./monaco.osrm* ch/
# # Release/osrm-contract.exe ch/monaco.osrm
# # cp -rf ch/* ../test/data/ch/
# # popd
# ./lib/binding/osrm-extract.exe --help

./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf
# ./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf

mkdir -p test/data/ch
cp test/data/monaco.osrm* test/data/ch/
./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm
# mkdir -p test/data/ch
# cp test/data/monaco.osrm* test/data/ch/
# ./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm

./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm
node test/nodejs/index.js
# ./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm
# node test/nodejs/index.js
- name: Build Node package
shell: bash
run: ./scripts/ci/node_package.sh
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -723,9 +723,10 @@ add_custom_target(uninstall


# Modular build system: each directory registered here provides its own CMakeLists.txt
if (NOT MSVC)
add_subdirectory(unit_tests)
add_subdirectory(src/benchmarks)

endif()
if (ENABLE_NODE_BINDINGS)
add_subdirectory(src/nodejs)
endif()
Expand Down
90 changes: 90 additions & 0 deletions scripts/ci/windows-build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@ECHO OFF
SETLOCAL
SET EL=0

ECHO NUMBER_OF_PROCESSORS^: %NUMBER_OF_PROCESSORS%

SET PROJECT_DIR=%CD%
SET CONFIGURATION=Release

mkdir build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cd build
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cmake -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -G "Visual Studio 17 2022" ..
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

msbuild OSRM.sln ^
/p:Configuration=%CONFIGURATION% ^
/p:Platform=x64 ^
/t:rebuild ^
/p:BuildInParallel=true ^
/m:%NUMBER_OF_PROCESSORS% ^
/toolsversion:Current ^
/clp:Verbosity=quiet ^
/nologo
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM CD %PROJECT_DIR%\build
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running extractor-tests.exe ...
@REM unit_tests\%CONFIGURATION%\extractor-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running contractor-tests.exe ...
@REM unit_tests\%CONFIGURATION%\contractor-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running engine-tests.exe ...
@REM unit_tests\%CONFIGURATION%\engine-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running util-tests.exe ...
@REM unit_tests\%CONFIGURATION%\util-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running server-tests.exe ...
@REM unit_tests\%CONFIGURATION%\server-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running partitioner-tests.exe ...
@REM unit_tests\%CONFIGURATION%\partitioner-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@REM ECHO running customizer-tests.exe ...
@REM unit_tests\%CONFIGURATION%\customizer-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

SET test_region=monaco
SET test_region_ch=ch\monaco
SET test_region_mld=mld\monaco
SET test_osm=%test_region%.osm.pbf
COPY %PROJECT_DIR%\test\data\%test_region%.osm.pbf %test_osm%
%CONFIGURATION%\osrm-extract.exe -p %PROJECT_DIR%\profiles\car.lua %test_osm%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

MKDIR ch
XCOPY %test_region%.osrm.* ch\
XCOPY %test_region%.osrm ch\
MKDIR mld
XCOPY %test_region%.osrm.* mld\
XCOPY %test_region%.osrm mld\
%CONFIGURATION%\osrm-contract.exe %test_region_ch%.osrm
%CONFIGURATION%\osrm-partition.exe %test_region_mld%.osrm
%CONFIGURATION%\osrm-customize.exe %test_region_mld%.osrm
XCOPY /Y ch\*.* ..\test\data\ch\
XCOPY /Y mld\*.* ..\test\data\mld\

@REM unit_tests\%CONFIGURATION%\library-tests.exe
@REM IF %ERRORLEVEL% NEQ 0 GOTO ERROR

:ERROR
ECHO ~~~~~~~~~~~~~~~~~~~~~~ ERROR %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ECHO ERRORLEVEL^: %ERRORLEVEL%
SET EL=%ERRORLEVEL%

:DONE
ECHO ~~~~~~~~~~~~~~~~~~~~~~ DONE %~f0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EXIT /b %EL%

0 comments on commit c0a2212

Please sign in to comment.