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
52 changes: 49 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ jobs:
if: runner.os == 'macOS'
run: |
brew update
brew install libzip eigen googletest ninja
brew install libzip eigen googletest ninja lcov

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install ninja -y
choco install opencppcoverage -y
New-Item -ItemType Directory -Force "$env:GITHUB_WORKSPACE\vcpkg_cache" | Out-Null
git clone https://github.com/microsoft/vcpkg "$env:GITHUB_WORKSPACE\vcpkg"
& "$env:GITHUB_WORKSPACE\vcpkg\bootstrap-vcpkg.bat"
Expand All @@ -59,7 +60,10 @@ jobs:
-DTRX_USE_CONAN=OFF \
-DTRX_BUILD_TESTS=ON \
-DTRX_BUILD_EXAMPLES=ON \
-DCMAKE_PREFIX_PATH="${BREW_PREFIX}"
-DCMAKE_PREFIX_PATH="${BREW_PREFIX}" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="--coverage" \
-DCMAKE_CXX_FLAGS="--coverage"

- name: Configure (Windows)
if: runner.os == 'Windows'
Expand All @@ -68,10 +72,52 @@ jobs:
-G Ninja
-DTRX_USE_CONAN=OFF
-DTRX_BUILD_TESTS=ON
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Build
run: cmake --build build --config Release

- name: Test
- name: Test (macOS)
if: runner.os == 'macOS'
run: ctest --test-dir build --output-on-failure -C Release

- name: Test with coverage (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: >
& "$env:ProgramFiles\OpenCppCoverage\OpenCppCoverage.exe"
--export_type cobertura:coverage.xml
--sources ${{ github.workspace }}
-- ctest --test-dir build --output-on-failure -C Release

- name: Generate coverage summary (macOS)
if: runner.os == 'macOS'
run: |
lcov --capture --directory build \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors mismatch,inconsistent,unsupported,format \
--output-file coverage.info
lcov --remove coverage.info "/opt/homebrew/*" "/Applications/Xcode_*.app/*" \
"/Users/runner/work/trx-cpp/trx-cpp/third_party/*" \
--ignore-errors mismatch,inconsistent,unsupported,format \
--output-file coverage.info
lcov --summary coverage.info --ignore-errors mismatch,inconsistent,unsupported,format

- name: Upload coverage to Codecov (macOS)
if: runner.os == 'macOS'
uses: codecov/codecov-action@v4
with:
files: coverage.info
flags: macos
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to Codecov (Windows)
if: runner.os == 'Windows'
uses: codecov/codecov-action@v4
with:
files: coverage.xml
flags: windows
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
coverage:
ignore:
- "third_party"
- "examples"
status:
project:
default:
Expand Down
11 changes: 11 additions & 0 deletions include/trx/trx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@

#include <Eigen/Core>
#include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <json11.hpp>
#include <limits.h>
#include <limits>
#include <math.h>
#include <sstream>
#include <stdexcept>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -530,6 +534,13 @@ void add_dps_from_text(TrxFile<DT> &trx, const std::string &name, const std::str
template <typename DT>
void add_dpv_from_tsf(TrxFile<DT> &trx, const std::string &name, const std::string &dtype, const std::string &path);

template <typename DT>
void export_dpv_to_tsf(const TrxFile<DT> &trx,
const std::string &name,
const std::string &path,
const std::string &timestamp,
const std::string &dtype = "float32");

/**
* @brief Utils function to zip on-disk memmaps
*
Expand Down
Loading
Loading