Skip to content

Commit

Permalink
Add tests for downstream builds
Browse files Browse the repository at this point in the history
This commit adds a new CI job that tests whether covfie can be used as a
dependency in a downstream project.
  • Loading branch information
stephenswat committed Nov 15, 2024
1 parent 7f4bbb6 commit 042c708
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This file is part of covfie, a part of the ACTS project
#
# Copyright (c) 2022 CERN
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.

name: Downstream Build Tests

on: [ push, pull_request ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
linux-core:
name: "Linux"

runs-on: "ubuntu-latest"

container: ubuntu:24.04

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: apt-get update && apt-get -y install
libboost-filesystem-dev
libboost-program-options-dev
libboost-log-dev
wget
cmake
g++
- name: Configure covfie
run: cmake
-DCMAKE_BUILD_TYPE=${{ matrix.BUILD }}
-DCOVFIE_FAIL_ON_WARNINGS=TRUE
-DCMAKE_CXX_STANDARD=20
-S $GITHUB_WORKSPACE
-B build_covfie
- name: Build covfie
run: cmake --build build_covfie -- -j $(nproc)
- name: Install covfie
run: cmake --install build_covfie --prefix "$GITHUB_WORKSPACE/.prefixes/covfie/"
- name: Configure downstream
run: cmake
-DCMAKE_CXX_STANDARD=20
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/.prefixes/covfie/"
-S $GITHUB_WORKSPACE/tests/downstream
-B build_downstream
- name: Build downstream
run: VERBOSE=1 cmake --build build_downstream -- -j $(nproc)
37 changes: 37 additions & 0 deletions tests/downstream/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file is part of covfie, a part of the ACTS project
#
# Copyright (c) 2022 CERN
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.

cmake_minimum_required(VERSION 3.18)

project("covfie_downstream" VERSION 0.0.0)

find_package(covfie REQUIRED)

add_executable(main main.cpp)

target_link_libraries(
main
covfie::core
covfie::cpu
)

if(TARGET core)
message(FATAL_ERROR "Target `core` should not exist.")
endif()

if(TARGET cpu)
message(FATAL_ERROR "Target `cpu` should not exist.")
endif()

if(TARGET benchmark_cpu)
message(FATAL_ERROR "Target `benchmark_cpu` should not exist.")
endif()

if(TARGET test_core)
message(FATAL_ERROR "Target `test_core` should not exist.")
endif()
16 changes: 16 additions & 0 deletions tests/downstream/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* This file is part of covfie, a part of the ACTS project
*
* Copyright (c) 2022 CERN
*
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/.
*/

#include <covfie/core/field.hpp>

int main(int argc, char ** argv)
{
return 0;
}

0 comments on commit 042c708

Please sign in to comment.