-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from WisdomToNorth/master
Folder organization and enable github action
- Loading branch information
Showing
20 changed files
with
593 additions
and
442 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Linux | ||
|
||
on: | ||
[push, pull_request] | ||
|
||
jobs: | ||
build-linux-gcc: | ||
runs-on: ubuntu-latest | ||
name: linux-gcc-relase | ||
|
||
env: | ||
targetName: Gui | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install brew and dependencies | ||
run: | | ||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)" | ||
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv) | ||
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) | ||
test -r ~/.profile | ||
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile | ||
echo "export PATH=\"$(brew --prefix)/bin:$PATH\"" >>~/.profile | ||
source ~/.profile | ||
brew install googletest | ||
brew install google-benchmark | ||
brew install ninja | ||
- name: Ninja gcc build Release | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
source ~/.profile | ||
cmake --no-warn-unused-cli \ | ||
-DCMAKE_BUILD_TYPE:STRING=Release \ | ||
-DCMAKE_CXX_STANDARD=20 \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \ | ||
-DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc \ | ||
-DCMAKE_CXX_COMPILER=/usr/bin/g++ \ | ||
-B${{github.workspace}}/build/Linux_Ninja_Release \ | ||
-S${{github.workspace}} -G Ninja | ||
cmake --build ${{github.workspace}}/build/Linux_Ninja_Release --config Release --target all -- | ||
- name: Execute Unit Tests | ||
working-directory: ${{github.workspace}}/build/Linux_Ninja_Release | ||
run: | | ||
ctest -T test -j 2 --output-on-failure | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: macOS | ||
|
||
on: | ||
[push, pull_request] | ||
|
||
jobs: | ||
mac-clang: | ||
runs-on: macos-latest | ||
name: mac-clang-release | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install brew and dependencies | ||
run: | | ||
brew install ninja | ||
brew install googletest | ||
brew install google-benchmark | ||
- name: Build Release | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
export PATH="/usr/local/opt/llvm/bin:$PATH" | ||
cmake \ | ||
-DCMAKE_BUILD_TYPE:STRING=Release \ | ||
-DCMAKE_CXX_STANDARD=20 \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \ | ||
-DCMAKE_C_COMPILER:FILEPATH=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-B${{github.workspace}}/build/Mac_Ninja_Release \ | ||
-S${{github.workspace}} -G Ninja | ||
cmake --build ${{github.workspace}}/build/Mac_Ninja_Release --config Release --target all -- | ||
- name: Execute Unit Tests Release | ||
working-directory: ${{github.workspace}}/build/Mac_Ninja_Release | ||
run: | | ||
ctest -T test -j 3 --output-on-failure | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Windows | ||
|
||
on: | ||
[push, pull_request] | ||
|
||
jobs: | ||
windows-msvc: | ||
|
||
runs-on: windows-latest | ||
name: windows-msvc-release | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure Compiler | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- name: Cache Vcpkg Packages | ||
id: vcpkg-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vcpkg_ci_env | ||
key: vcpkg-cache-windowsci | ||
restore-keys: | | ||
vcpkg-cache-windowsci | ||
- name: Install Vcpkg | ||
if: steps.vcpkg-cache.outputs.cache-hit != 'true' | ||
shell: powershell | ||
run: | | ||
echo "VCPKG_ROOT=" >> $GITHUB_ENV | ||
git clone https://github.com/Microsoft/vcpkg.git vcpkg_ci_env | ||
cd vcpkg_ci_env | ||
.\bootstrap-vcpkg.bat | ||
.\vcpkg integrate install | ||
Add-Content -Path .\triplets\x64-windows.cmake -Value "set(VCPKG_BUILD_TYPE release)" | ||
vcpkg install gtest --triplet x64-windows | ||
vcpkg install benchmark --triplet x64-windows | ||
Remove-Item -Recurse -Force buildtrees | ||
Remove-Item -Recurse -Force downloads | ||
Remove-Item -Recurse -Force packages | ||
Remove-Item -Recurse -Force ports | ||
Remove-Item -Recurse -Force triplets | ||
ls | ||
- name: Build Release | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
cmd.exe /k "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | ||
cmake -DVCPKG_MANIFEST_MODE=OFF ` | ||
-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_STANDARD=20 ` | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=cl.exe ` | ||
-DCMAKE_CXX_COMPILER=cl.exe ` | ||
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg_ci_env/scripts/buildsystems/vcpkg.cmake ` | ||
-B${{github.workspace}}/build/win_msvc_release ` | ||
-S${{github.workspace}} -G Ninja | ||
cmake --build ${{github.workspace}}/build/win_msvc_release --config Release --target all -- | ||
- name: Execute Unit Tests Release | ||
working-directory: ${{github.workspace}}/build/win_msvc_release | ||
shell: cmd | ||
env: | ||
PATH: ${{env.PATH}} | ||
run: | | ||
ctest -T test -j 2 --output-on-failure | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
*.user | ||
# Forder | ||
.vs/* | ||
.idea/* | ||
x64/* | ||
CMakeLists.txt.user | ||
out | ||
build | ||
install | ||
*.ts | ||
*.qm | ||
.vscode | ||
|
||
package | ||
dist | ||
|
||
regressions/output | ||
regressions/Files | ||
WinUserSetting.cmake | ||
launch.json | ||
settings.json | ||
filename.txt | ||
CMakePresets.json | ||
|
||
.VSCodeCounter/* | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cmake_minimum_required(VERSION 3.11) | ||
add_subdirectory(polylinefactory) | ||
add_subdirectory(tests) | ||
add_subdirectory(benchmarks) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.11) | ||
include (googletest.cmake) | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
macro(cavc_add_test name) | ||
add_executable(${name} ${name}.cpp) | ||
|
||
target_include_directories(${name} | ||
PRIVATE include/) | ||
set(gtesthelper | ||
${CMAKE_CURRENT_SOURCE_DIR}/c_api_test_helpers.hpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/testhelpers.hpp | ||
) | ||
|
||
target_link_libraries(${name} | ||
PRIVATE PolylineFactory) | ||
macro(cavc_add_test name) | ||
add_executable(${name} ${name}.cpp ${gtesthelper}) | ||
|
||
target_link_libraries(${name} | ||
PRIVATE ${CAVC_C_API_LIB}) | ||
target_include_directories(${name} | ||
PRIVATE | ||
${GTEST_INCLUDE_DIRS} | ||
${CMAKE_SOURCE_DIR} | ||
${CMAKE_SOURCE_DIR}/include) | ||
|
||
target_link_libraries(${name} | ||
PRIVATE gtest_main gtest gmock) | ||
target_link_libraries(${name} | ||
PRIVATE | ||
PolylineFactory | ||
${CAVC_CPP_HEADER_ONLY_LIB} | ||
${CAVC_C_API_LIB} | ||
GTest::gtest_main | ||
GTest::gtest | ||
GTest::gmock) | ||
|
||
# note: adding executable as single test rather than discovering tests via gtest_discover_tests | ||
# because it adds parmeterized tests as individual tests and ctest runs them one by one which is | ||
# quite slow | ||
add_test(NAME ${name} COMMAND ${name}) | ||
gtest_add_tests(TARGET ${name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
endmacro() | ||
|
||
cavc_add_test(cavc_pline_tests) | ||
cavc_add_test(cavc_pline_function_tests) | ||
cavc_add_test(cavc_parallel_offset_tests) | ||
cavc_add_test(cavc_combine_plines_tests) | ||
cavc_add_test(staticspatialindex_tests) | ||
cavc_add_test(TEST_cavc_pline) | ||
cavc_add_test(TEST_cavc_pline_function) | ||
cavc_add_test(TEST_cavc_parallel_offset) | ||
cavc_add_test(TEST_cavc_combine_plines) | ||
cavc_add_test(TEST_staticspatialindex) |
Oops, something went wrong.