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
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
# ------------------------------------------------------------
# Build and run the standalone timestamp-format test.
# Pure C++17 stdlib — no external dependencies needed.
# ------------------------------------------------------------
build-test:
name: Build & Run Standalone Test
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Build test_timestamp_format
working-directory: test
run: make clean && make

- name: Run test_timestamp_format
working-directory: test
run: make run

# ------------------------------------------------------------
# CMake configure check with core deps (cpr + influxdb-cxx).
# DCDB and QDMI-Devices are not available in CI so the actual
# link step is skipped — configure verifies CMakeLists.txt is
# well-formed and that core deps resolve correctly.
# ------------------------------------------------------------
cmake-configure:
name: CMake Configure Check
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install system prerequisites
run: |
sudo apt-get update -q
sudo apt-get install -y \
cmake \
libuv1-dev \
libssl-dev \
libcurl4-openssl-dev

- name: Clone core dependencies
run: bash extern/clone.sh

- name: Build core dependencies
run: bash extern/build.sh --jobs $(nproc)

- name: CMake configure
run: |
cmake -S . -B build \
-DCMAKE_PREFIX_PATH="$PWD/extern/installed"

# ------------------------------------------------------------
# Static analysis with cppcheck.
# Checks src/ and test/ for common C++ issues at warning level
# without requiring a full build.
# ------------------------------------------------------------
lint-cpp:
name: Lint C++ (cppcheck)
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Install cppcheck
run: |
sudo apt-get update -q
sudo apt-get install -y cppcheck

- name: Run cppcheck
run: |
cppcheck \
--enable=warning,performance \
--error-exitcode=1 \
--suppress=missingIncludeSystem \
--std=c++17 \
src/ test/
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,20 @@ target_include_directories(nlohmann_json_iface INTERFACE
# Maybe thread lib on Linux
find_package(Threads REQUIRED)

# Apply the include directories
target_include_directories(mqss_dcdb_daemon PRIVATE
${DCDB_INCLUDE_DIR}
${DCDB_COMMON_INCLUDE_DIR}
${QDMI_INCLUDE_DIR}
${DCDB_QDMI_INCLUDE_DIR}
)

# Apply linking the dependencies
# Apply the include directories (guard optional DCDB/QDMI deps against NOTFOUND)
foreach(_dir DCDB_INCLUDE_DIR DCDB_COMMON_INCLUDE_DIR QDMI_INCLUDE_DIR DCDB_QDMI_INCLUDE_DIR)
if(${_dir})
target_include_directories(mqss_dcdb_daemon PRIVATE "${${_dir}}")
endif()
endforeach()

# Apply linking the dependencies (guard optional DCDB/QDMI deps against NOTFOUND)
foreach(_lib DCDB_LIBRARY DCDB_QDMI_LIBRARY CASSANDRA_LIBRARY)
if(${_lib})
target_link_libraries(mqss_dcdb_daemon PRIVATE "${${_lib}}")
endif()
endforeach()
target_link_libraries(mqss_dcdb_daemon PRIVATE
${DCDB_LIBRARY}
${DCDB_QDMI_LIBRARY}
${CASSANDRA_LIBRARY}
Threads::Threads
InfluxData::InfluxDB
nlohmann_json_iface
Expand Down
Loading