Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Code Coverage

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
name: ubuntu-latest, Debug
runs-on: ubuntu-latest
steps:
- name: Checkout Respond Repository
uses: actions/checkout@v4

- name: Install Boost
uses: MarkusJx/install-boost@v2.4.5
id: install-boost
with:
boost_version: 1.86.0
platform_version: 22.04

- name: Install Eigen3
uses: kupns-aka-kupa/setup-eigen3@master
id: install-eigen3
with:
version: 3.4.0
env:
CMAKE_GENERATOR: Ninja

- name: Configure Project
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
EIGEN3_INCLUDE_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_INCLUDE_DIR }}
EIGEN3_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_DIR}}
run: cmake --workflow --preset gcc-debug

- name: Check Test Coverage
uses: threeal/gcovr-action@v1.1.0
with:
working-directory: ${{github.workspace}}
excludes: |
Eigen3/*
boost/*
gtest/*
googletest/*
build/*
fail-under-line: 80
html-out: coverage.html
html-details: true
html-title: TESPOND Test Coverage Report
html-theme: github.green
- name: Upload Code Coverage Results
uses: actions/upload-artifact@v4
with:
name: coverage
path: ${{github.workspace}}/coverage.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: clang-format Check
name: Code Formatting
on:
push:
branches: '*'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload Static Release
name: Ubuntu Static Library Release

on:
release:
Expand All @@ -13,17 +13,13 @@ env:

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
name: Build Release
runs-on: ${{ matrix.os }}
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Ubuntu Install Boost
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: MarkusJx/install-boost@v2.4.5
id: install-boost
with:
Expand All @@ -34,20 +30,17 @@ jobs:
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=OFF
cmake --workflow --preset gcc-release
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Get Latest Release Tag
id: get-latest-release
uses: ddbaptiste/get-latest-release@v1.0.0

- name: Release and Upload
run: gh release upload ${{ steps.get-latest-release.outputs.latest-release }} libDataManagement.a include/DataManagerBase.hpp include/DataManager.hpp
working-directory: ${{github.workspace}}/build
run: gh release upload ${{ steps.get-latest-release.outputs.latest-release }} datamanagement-1.1.0-Linux.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Cross Platform Testing
name: Ubuntu Unit Testing

on:
push:
Expand All @@ -25,23 +25,22 @@ jobs:
boost_version: 1.84.0
platform_version: 22.04
toolset: 'gcc'

- name: Install Eigen3
uses: kupns-aka-kupa/setup-eigen3@master
id: install-eigen3
with:
version: 3.4.0
env:
CMAKE_GENERATOR: Ninja

- name: Install GTest Ubuntu
run: sudo apt-get install libgtest-dev

- name: Create Build Directory
run: mkdir build

- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=OFF -DDATAMANAGEMENT_INSTALL=OFF
working-directory: ${{github.workspace}}
run: cmake --workflow --preset gcc-debug
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build Project
working-directory: ${{github.workspace}}/build
run: cmake --build .

- name: Run Tests
working-directory: ${{github.workspace}}/build
run: tests/dataTests
EIGEN3_INCLUDE_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_INCLUDE_DIR }}
EIGEN3_DIR: ${{ steps.install-eigen3.outputs.EIGEN3_DIR}}
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ set_target_properties(datamanagement PROPERTIES VERSION ${DATAMANAGEMENT_VERSION
# ---------------------------------------------------------------------------------------
# Build Tests
# ---------------------------------------------------------------------------------------
if(DATAMANAGEMENT_BUILD_TESTS)
message(STATUS "Generating tests")
enable_testing()
add_subdirectory(tests)
endif()
include(cmake/BuildBinaries.cmake)

# ---------------------------------------------------------------------------------------
# Install
Expand Down
145 changes: 95 additions & 50 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,65 @@
"include": [],
"configurePresets": [
{
"name": "linux-ninja",
"name": "configuration-common",
"description": "General Configuration Settings for All Configs",
"hidden": true,
"displayName": "Linux Config",
"description": "Linux Config build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"DATAMANAGEMENT_BUILD_PIC": {
"type": "BOOL",
"value": "ON"
}
},
"environment": {}
"installDir": "${sourceDir}/install"
},
{
"name": "linux-ninja-debug",
"inherits": "linux-ninja",
"name": "configuration-common-linux",
"description": "Linux Configuration Settings for GCC and Clang",
"hidden": true,
"inherits": "configuration-common",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"architecture": {
"value": "x64",
"strategy": "external"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Debug"
}
"DATAMANAGEMENT_BUILD_PIC": "ON"
}
},
{
"name": "linux-ninja-release",
"inherits": "linux-ninja",
"hidden": true,
"name": "gcc-debug",
"displayName": "gcc Debug",
"description": "Target Linux with the GCC compiler, debug build type",
"inherits": "configuration-common-linux",
"cacheVariables": {
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "Release"
}
"CMAKE_BUILD_TYPE": "Debug",
"DATAMANAGEMENT_BUILD_TESTS": "ON",
"DATAMANAGEMENT_CALCULATE_COVERAGE": "ON",
"DATAMANAGEMENT_INSTALL": "OFF"
}
},
{
"name": "linux-ninja-debug-tests",
"inherits": "linux-ninja-debug",
"name": "gcc-release",
"displayName": "gcc Release",
"description": "Target Linux with the GCC compiler, release build type",
"inherits": "configuration-common-linux",
"cacheVariables": {
"DATAMANAGEMENT_BUILD_TESTS": {
"type": "BOOL",
"value": "ON"
},
"DATAMANAGEMENT_CALCULATE_COVERAGE": {
"type": "BOOL",
"value": "ON"
}
"CMAKE_BUILD_TYPE": "Release",
"DATAMANAGEMENT_BUILD_TESTS": "OFF",
"DATAMANAGEMENT_CALCULATE_COVERAGE": "OFF",
"DATAMANAGEMENT_INSTALL": "ON"
}
}
],
"buildPresets": [
{
"name": "default-library",
"configurePreset": "linux-ninja-release",
"jobs": 4
}
],
"testPresets": [
{
"name": "default-test",
"configurePreset": "linux-ninja-debug-tests",
"configuration": "Debug",
"name": "test-common",
"description": "Settings for all tests",
"hidden": true,
"output": {
"verbosity": "verbose",
"outputOnFailure": true
Expand All @@ -79,36 +75,85 @@
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "gcc-debug",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "gcc-debug"
},
{
"name": "gcc-release",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "gcc-release"
}
],
"buildPresets": [
{
"name": "gcc-release",
"configurePreset": "gcc-release",
"jobs": 8
},
{
"name": "gcc-install",
"configurePreset": "gcc-release",
"jobs": 8,
"targets": [
"install"
]
},
{
"name": "gcc-debug",
"configurePreset": "gcc-debug",
"jobs": 8
}
],
"packagePresets": [
{
"name": "default-package",
"configurePreset": "linux-ninja-release",
"name": "gcc-release",
"configurePreset": "gcc-release",
"generators": [
"TGZ"
]
}
],
"workflowPresets": [
{
"name": "default",
"description": "Developer Debugging workflow without installation",
"name": "gcc-debug",
"steps": [
{
"type": "configure",
"name": "linux-ninja-release"
"name": "gcc-debug"
},
{
"type": "build",
"name": "default-library"
"name": "gcc-debug"
},
{
"type": "test",
"name": "default-test"
"name": "gcc-debug"
}
]
},
{
"description": "Release workflow without tests",
"name": "gcc-release",
"steps": [
{
"type": "configure",
"name": "gcc-release"
},
{
"type": "build",
"name": "gcc-release"
},
{
"type": "package",
"name": "default-package"
"name": "gcc-release"
}
]
}
Expand Down
9 changes: 9 additions & 0 deletions cmake/BuildBinaries.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if(DATAMANAGEMENT_BUILD_TESTS OR DATAMANAGEMENT_BUILD_ALL)
message(STATUS "Generating tests")
if(DATAMANAGEMENT_CALCULATE_COVERAGE)
message(STATUS "Calculating Code Coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
endif()
enable_testing()
add_subdirectory(tests)
endif()
2 changes: 2 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ option(DATAMANAGEMENT_BUILD_PIC "Build position independent code (-fPIC)" OFF)
# testing options
option(DATAMANAGEMENT_BUILD_TESTS "Build tests" OFF)

option(DATAMANAGEMENT_CALCULATE_COVERAGE "Build Coverage Files" OFF)

# install options
option(DATAMANAGEMENT_INSTALL "Generate the install target" ${DATAMANAGEMENT_MASTER_PROJECT})
Loading
Loading