Skip to content

Commit

Permalink
update integrationtests
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Jan 10, 2024
1 parent 600ac48 commit 769dd8e
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/integrationtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@ jobs:
- name: Checkout Loki
uses: actions/checkout@v2

- name: Download and extract boost, no building required
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@v2
with:
path: |
dependencies/benchmark-install
dependencies/boost
dependencies/googletest-install
key: ${{ runner.os }}-benchmark-${{ hashFiles('**/dependencies/benchmark/CMakeLists.txt', '**/dependencies/boost/CMakeLists.txt', '**/dependencies/googletest/CMakeLists.txt') }} # Unique key based on OS and CMake files

- name: Configure, Build, and Install Dependencies
# if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
wget --no-check-certificate 'https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz'
tar xf boost_1_84_0.tar.gz
- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/boost_1_84_0" -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/loki-install" -S . -B build

- name: Build Loki
run: export CXXFLAGS="-Werror" && cmake --build build -j$(nproc)

- name: Install Loki
run: cmake --install build
cd dependencies
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/dependencies/installs
cmake --build build -j$(nproc)
- name: Build and Test Project
run: |
cd tests/integration
cmake -S . -B build -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/boost_1_84_0;$GITHUB_WORKSPACE/loki-install"
cmake -S . -B build -j$(nproc) -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/dependencies/installs"
cmake --build build
8 changes: 8 additions & 0 deletions tests/integration/dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.0)

project(dependencies)

add_subdirectory(benchmark)
add_subdirectory(boost)
add_subdirectory(googletest)
add_subdirectory(loki)
26 changes: 26 additions & 0 deletions tests/integration/dependencies/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.13)
project(InstallBenchmark)

include(ExternalProject)

list(APPEND CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_BUILD_TYPE=Release"
"-DBENCHMARK_ENABLE_GTEST_TESTS=OFF"
)

message(${CMAKE_BINARY_DIR}/benchmark-install)

message(STATUS "Preparing external project \"benchmark\" with args:")
foreach(CMAKE_ARG ${CMAKE_ARGS})
message(STATUS "-- ${CMAKE_ARG}")
endforeach()

ExternalProject_Add(
benchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.8.3
PREFIX ${CMAKE_BINARY_DIR}/benchmark
CMAKE_ARGS "${CMAKE_ARGS}"
)

19 changes: 19 additions & 0 deletions tests/integration/dependencies/boost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.13)
project(DownloadBoost)

include(ExternalProject)

message(STATUS "Preparing external project \"boost\":")

ExternalProject_Add(
BoostHeaders
URL https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.gz
PREFIX ${CMAKE_BINARY_DIR}/external/boost
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/boost ${CMAKE_INSTALL_PREFIX}/include/boost
COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/tools/cmake ${CMAKE_INSTALL_PREFIX}/lib/cmake
UPDATE_DISCONNECTED 1
)

set(BOOST_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX})
21 changes: 21 additions & 0 deletions tests/integration/dependencies/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.13)
project(InstallGoogletest)

include(ExternalProject)

list(APPEND CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
)

message(STATUS "Preparing external project \"googletest\" with args:")
foreach(CMAKE_ARG ${CMAKE_ARGS})
message(STATUS "-- ${CMAKE_ARG}")
endforeach()

ExternalProject_Add(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
PREFIX ${CMAKE_BINARY_DIR}/googletest
CMAKE_ARGS "${CMAKE_ARGS}"
)
24 changes: 24 additions & 0 deletions tests/integration/dependencies/loki/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.13)
project(InstallGoogletest)

include(ExternalProject)

list(APPEND CMAKE_ARGS
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}"
"-DCMAKE_BUILD_TYPE=Release"
)

message(STATUS "Preparing external project \"loki\" with args:")
foreach(CMAKE_ARG ${CMAKE_ARGS})
message(STATUS "-- ${CMAKE_ARG}")
endforeach()

ExternalProject_Add(
loki
GIT_REPOSITORY https://github.com/drexlerd/Loki.git
GIT_TAG main
PREFIX ${CMAKE_BINARY_DIR}/loki
DEPENDS BoostHeaders googletest benchmark
CMAKE_ARGS "${CMAKE_ARGS}"
)

0 comments on commit 769dd8e

Please sign in to comment.