-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9dfc26
commit bd55966
Showing
6 changed files
with
372 additions
and
22 deletions.
There are no files selected for viewing
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,45 @@ | ||
name: Build & Test | ||
on: [ push, pull_request ] | ||
jobs: | ||
build: | ||
name: Testing on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Get latest CMake and ninja | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: Cache conan | ||
uses: actions/[email protected] | ||
with: | ||
key: conan-${{ runner.os }}-${{ hashFiles('**/Testbed/CMakeLists.txt') }} | ||
path: ~/.conan/ | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Enable Developer Command Prompt | ||
uses: ilammy/[email protected] | ||
|
||
- name: Install conan | ||
run: pip install conan | ||
|
||
- name: Configure | ||
env: | ||
CONAN_USER_HOME_SHORT: None | ||
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=ON Testbed | ||
|
||
- name: Build | ||
run: ninja | ||
|
||
- name: Test | ||
run: ctest --output-on-failure | ||
|
||
- name: Clean Conan pkgs | ||
run: conan remove "*" -fsb |
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,35 +1,62 @@ | ||
#------------------------------------------------------- | ||
# Testbed Main Build Script | ||
#------------------------------------------------------- | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR}) | ||
cmake_minimum_required(VERSION 3.0) | ||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR}) | ||
|
||
project(testbed) | ||
|
||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 14) | ||
|
||
if (USE_CONAN) | ||
if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") | ||
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") | ||
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake" "${CMAKE_BINARY_DIR}/conan.cmake") | ||
endif () | ||
|
||
include(${CMAKE_BINARY_DIR}/conan.cmake) | ||
conan_cmake_configure(REQUIRES angelscript/2.35.1 catch2/3.1.0 GENERATORS cmake_find_package) | ||
conan_cmake_autodetect(settings) | ||
conan_cmake_install(PATH_OR_REFERENCE . BUILD missing SETTINGS ${settings}) | ||
endif () | ||
|
||
find_package(Angelscript REQUIRED) | ||
find_package(Catch2) | ||
|
||
project(Testbed) | ||
|
||
file(COPY "${CMAKE_SOURCE_DIR}/../Example.as" DESTINATION "${CMAKE_BINARY_DIR}") | ||
|
||
set(SRC | ||
../RefCountingObject.h | ||
../RefCountingObjectHandle.h | ||
../RefCountingObjectPtr.h | ||
debug_log.h | ||
scriptstdstring.h | ||
|
||
../Example.cpp | ||
../RefCountingObjectHandle.cpp | ||
main.cpp | ||
scriptstdstring.cpp | ||
) | ||
|
||
add_executable(${PROJECT_NAME} ${SRC}) | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE RCO_ENABLE_DEBUGTRACE) | ||
../RefCountingObject.h | ||
../RefCountingObjectPtr.h | ||
debug_log.h | ||
scriptstdstring.h | ||
|
||
../Example.cpp | ||
|
||
scriptstdstring.cpp | ||
) | ||
|
||
add_executable(${PROJECT_NAME} ${SRC} main.cpp) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE Angelscript::angelscript) | ||
|
||
if (Catch2_FOUND) | ||
include(CTest) | ||
include(Catch) | ||
enable_testing() | ||
|
||
set(TEST_PR_NAME "${PROJECT_NAME}_tests") | ||
|
||
add_executable(${TEST_PR_NAME} ${SRC} test.cpp) | ||
target_link_libraries(${TEST_PR_NAME} PRIVATE Catch2::Catch2 Angelscript::angelscript Catch2::Catch2WithMain) | ||
|
||
catch_discover_tests(${TEST_PR_NAME}) | ||
endif () | ||
|
||
if (WIN32) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE Winmm) | ||
endif() | ||
if (Catch2_FOUND) | ||
target_link_libraries(${TEST_PR_NAME} PRIVATE Winmm) | ||
endif () | ||
endif () |
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,5 +1,6 @@ | ||
[requires] | ||
angelscript/2.35.1 | ||
catch2/3.1.0 | ||
|
||
[generators] | ||
cmake_find_package |
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
Oops, something went wrong.