Skip to content

Commit

Permalink
Add installation test in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jfalcou committed Jul 2, 2022
1 parent 9e19ba5 commit 4da3907
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cleanup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Container image that runs your code
FROM jfalcou/compilers:v3
FROM jfalcou/compilers:v4

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
Expand Down
8 changes: 8 additions & 0 deletions .github/actions/integration/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Container image that runs your code
FROM jfalcou/compilers:v4

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
6 changes: 6 additions & 0 deletions .github/actions/integration/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# action.yml
name: 'Checks installation process'
description: 'Checks installation process'
runs:
using: 'docker'
image: 'Dockerfile'
21 changes: 21 additions & 0 deletions .github/actions/integration/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh -l
set -e

echo "::group::Configure EVE"
mkdir build && cd build
cmake .. -G Ninja
echo "::endgroup::"

echo "::group::Install EVE"
ninja install | grep cmake
cd ..
echo "::endgroup::"

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

return 0;
2 changes: 1 addition & 1 deletion .github/actions/run_docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Container image that runs your code
FROM jfalcou/compilers:v3
FROM jfalcou/compilers:v4

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ concurrency:
cancel-in-progress: true

jobs:

install:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Fetch current branch
uses: actions/checkout@v2
- name: Configure, install the library and check for proper installation
uses: ./.github/actions/integration

specials:
needs: install
runs-on: self-hosted
strategy:
fail-fast: false
Expand All @@ -35,6 +47,7 @@ jobs:
uses: ./.github/actions/cleanup

mainline:
needs: install
runs-on: self-hosted
strategy:
fail-fast: false
Expand Down Expand Up @@ -71,6 +84,7 @@ jobs:

supplemental:
runs-on: ubuntu-latest
needs: install
strategy:
fail-fast: false
matrix:
Expand Down
14 changes: 14 additions & 0 deletions integration/install-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
##==================================================================================================
## EVE - Expressive Vector Engine
## Copyright : EVE Contributors & Maintainers
## SPDX-License-Identifier: MIT
##==================================================================================================
cmake_minimum_required(VERSION 3.22)
project(eve-install-test LANGUAGES CXX)

find_package(eve)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/lib")

add_executable(test_eve main.cpp)
target_link_libraries(test_eve PUBLIC ${EVE_LIBRARIES})
13 changes: 13 additions & 0 deletions integration/install-test/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <iostream>
#include <eve/wide.hpp>
#include <eve/module/core.hpp>

int main()
{
eve::wide<float> x( [](auto i, auto) { return 1.f+i; } );
std::cout << "x = " << x << "\n";
std::cout << "2*x = " << x + x << "\n";
std::cout << "x^0.5 = " << eve::sqrt(x) << "\n";

return 0;
}

0 comments on commit 4da3907

Please sign in to comment.