Skip to content

Commit

Permalink
Test FetchContent support
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalcou committed Jul 2, 2022
1 parent 37743f7 commit 5eaa330
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/actions/integration/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# action.yml
name: 'Checks installation process'
description: 'Checks installation process'
inputs:
branch: # Current branch
description: ' Current branch'
required: false
default: 'main'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.branch }}
17 changes: 12 additions & 5 deletions .github/actions/integration/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
#!/bin/sh -l
set -e

echo "::group::Configure EVE"
echo "::group::Prepare EVE repository for branch " $1
mkdir build && cd build
cmake .. -G Ninja
echo "::endgroup::"

echo "::group::Install EVE"
ninja install | grep cmake
CURRENT_SHA1=`git rev-parse HEAD`
cd ..
echo "::endgroup::"

echo "::group::Compile EVE-dependent project"
echo "::group::Test EVE via the install target"
mkdir install-test && cd install-test
cmake ../integration/install-test -G Ninja
ninja test_eve
./test_eve
cd ..
echo "::endgroup::"

echo "::group::Test EVE via FetchContent"
mkdir fetch-test && cd fetch-test
cmake ../integration/fetch-test -G Ninja -DEVE_SHA1=$1
ninja test_eve
./test_eve
cd ..
echo "::endgroup::"

return 0;
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
uses: actions/checkout@v2
- name: Configure, install the library and check for proper installation
uses: ./.github/actions/integration
with:
branch: '${{ github.head_ref }}'

specials:
needs: install
Expand Down
24 changes: 24 additions & 0 deletions integration/fetch-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##==================================================================================================
## EVE - Expressive Vector Engine
## Copyright : EVE Contributors & Maintainers
## SPDX-License-Identifier: MIT
##==================================================================================================
cmake_minimum_required(VERSION 3.19)
project(eve-install-test LANGUAGES CXX)

message(STATUS "Testing FetchContent for branch ${EVE_SHA1}")

# Enable FetchContent
include(FetchContent)

# Retrieve EVE
FetchContent_Declare(eve
GIT_REPOSITORY https://github.com/jfalcou/eve.git
GIT_TAG ${EVE_SHA1}
)

FetchContent_MakeAvailable(eve)

# make available
add_executable(test_eve ../main.cpp)
target_link_libraries(test_eve PUBLIC eve::eve)
2 changes: 1 addition & 1 deletion integration/install-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Copyright : EVE Contributors & Maintainers
## SPDX-License-Identifier: MIT
##==================================================================================================
cmake_minimum_required(VERSION 3.22)
cmake_minimum_required(VERSION 3.19)
project(eve-install-test LANGUAGES CXX)

## Points to the installation folder for EVE
Expand Down

0 comments on commit 5eaa330

Please sign in to comment.