Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2a21b02
Initial plan
Copilot Jul 7, 2025
a1f550d
Add comprehensive C++ SDK implementation guidelines
Copilot Jul 7, 2025
c676ef7
Implement comprehensive C++ SDK foundation with full architecture
Copilot Jul 7, 2025
abdea86
Replace base58 stubs with real implementation, fix URL validation, ad…
Copilot Jul 7, 2025
a92017b
Add comprehensive base58/URL tests, refactor enums to use maps, impro…
Copilot Jul 7, 2025
1ee49b2
Fix base58 tests, improve URL validation, resolve compilation issues
Copilot Jul 7, 2025
282fabc
Add comprehensive documentation: usage guide, troubleshooting, and C …
Copilot Jul 7, 2025
a629085
Implement custom deleters, MSVC CI support, and C SDK bridge with RAI…
Copilot Jul 7, 2025
8bc9dd7
Fix deprecated GitHub Actions: upgrade upload-artifact and codecov-ac…
Copilot Jul 8, 2025
340d598
Fix libsodium dependency in CI workflow and add robust CMake detection
Copilot Jul 8, 2025
eca3007
Fix CI libsodium dependency: add explicit installation steps before C…
Copilot Jul 8, 2025
48e0f92
Update cpp_sdk.yml
0xrinegade Jul 8, 2025
18dc77d
Fix libsodium installation in all CI jobs: add missing step to docume…
Copilot Jul 8, 2025
4b8426a
Fix GTest installation in CI using libgtest-dev package and manual build
Copilot Jul 8, 2025
47e35e3
Fix critical issues: strcpy safety, URL validation, base58 decoding, …
Copilot Jul 8, 2025
a4f4ef5
Fix macOS libsodium linking: add brew path configuration and improve …
Copilot Jul 8, 2025
b6ff81a
Update cpp_sdk.yml
0xrinegade Jul 8, 2025
f787c01
Fix CI failures: documentation build, code formatting, and performanc…
Copilot Jul 8, 2025
4b733a2
Fix CI failures: doxygen output directory, lcov installation, and per…
Copilot Jul 8, 2025
f1fff46
Fix doxygen documentation output path to match CI workflow expectations
Copilot Jul 8, 2025
3afc1b1
Fix performance test timeouts for CI environments with generous timeo…
Copilot Jul 9, 2025
bcd8b1c
Fix clang-format violations in C++ SDK files
Copilot Jul 9, 2025
30e92bc
Fix CI static-analysis job: exclude build directory from clang-format…
Copilot Jul 9, 2025
7f0c213
Fix GitHub Actions test job: remove duplicate valgrind step from regu…
Copilot Jul 9, 2025
5ed1ddb
Fix memory-safety CI job: clean build dirs, use mkdir -p, improve git…
Copilot Jul 9, 2025
1a6ac96
Fix coverage job failure: proper lcov configuration and test execution
Copilot Jul 9, 2025
f2bdb99
Fix coverage job GCC/gcov version mismatch
Copilot Jul 9, 2025
ac24e90
Fix CI GCC-8 installation failure: use default Ubuntu GCC for coverage
Copilot Jul 9, 2025
c56ecd0
Update cpp_sdk.yml
larp0 Jul 9, 2025
d3225ff
Fix enum initializer list assignments to prevent array-bounds warnings
Copilot Jul 9, 2025
9759c02
Fix coverage job: add debug output and improve error handling
Copilot Jul 9, 2025
ac233e4
Fix GCC 13 regex warning: disable -Wmaybe-uninitialized for stubs.cpp
Copilot Jul 9, 2025
3a0d563
Fix CI failures: resolve clang-tidy warning and clang-format violations
Copilot Jul 10, 2025
85bc12d
Fix Windows CI: use vcpkg for Google Test, PowerShell shell, and prop…
Copilot Jul 10, 2025
2402c08
Fix Windows build issues: vcpkg integration, MSVC compatibility fixes
Copilot Jul 10, 2025
ce58ebc
Fix Windows sanitizer build failure: exclude sanitizers on Windows pl…
Copilot Jul 10, 2025
32200cd
Fix Windows CI: improve vcpkg setup, PowerShell syntax, and error han…
Copilot Jul 10, 2025
995c301
Fix invalid GitHub Actions workflow syntax on line 170
Copilot Jul 11, 2025
531a391
Fix Windows MSVC deprecated function warnings: add cross-platform saf…
Copilot Jul 11, 2025
eeffe2d
style: apply clang-format to common.hpp to fix CI style violations
Copilot Jul 11, 2025
68102c3
style: fix clang-format violations in static analysis
Copilot Jul 11, 2025
7ae403a
style: fix clang-format violations in common.hpp
Copilot Jul 11, 2025
cb833c8
Fix Windows regex memory issue for long URLs - prevent std::regex_error
Copilot Jul 11, 2025
df63544
fix(cpp): replace std::getenv with safe_getenv in url validation tests
Copilot Jul 12, 2025
9b465e6
style: fix clang-format violations in stubs.cpp and common.hpp
Copilot Jul 13, 2025
7781e0b
Fix C++ SDK integration tests and Windows MSVC pragma compatibility
Copilot Jul 13, 2025
9d0341e
style: fix clang-format-15 violations in common.hpp pointer spacing
Copilot Jul 13, 2025
8611a2d
Fix C++ SDK integration test execution for Windows CI builds
Copilot Jul 13, 2025
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
331 changes: 331 additions & 0 deletions .github/workflows/cpp_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,331 @@
name: C++ SDK CI

on:
push:
branches: [ main, develop ]
paths:
- 'cpp_sdk/**'
- '.github/workflows/cpp_sdk.yml'
pull_request:
branches: [ main, develop ]
paths:
- 'cpp_sdk/**'
- '.github/workflows/cpp_sdk.yml'

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build-type: [Debug, Release]
compiler: [gcc, clang, msvc]
exclude:
- os: windows-latest
compiler: gcc
- os: macos-latest
compiler: gcc
- os: ubuntu-latest
compiler: msvc
- os: macos-latest
compiler: msvc

steps:
- uses: actions/checkout@v4

- name: Install libsodium
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y libsodium-dev lcov



- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y cmake ninja-build pkg-config valgrind
if [ "${{ matrix.compiler }}" = "clang" ]; then
sudo apt-get install -y clang-15
echo "CC=clang-15" >> $GITHUB_ENV
echo "CXX=clang++-15" >> $GITHUB_ENV
fi

- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install cmake ninja libsodium pkg-config lcov
BREW_PREFIX=$(brew --prefix)
echo "PKG_CONFIG_PATH=${BREW_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV
echo "CMAKE_PREFIX_PATH=${BREW_PREFIX}:${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
echo "LIBRARY_PATH=${BREW_PREFIX}/lib:${LIBRARY_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${BREW_PREFIX}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${BREW_PREFIX}/lib:${DYLD_LIBRARY_PATH}" >> $GITHUB_ENV
if [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
fi

- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
timeout-minutes: 15
run: |
# Install basic tools
choco install cmake ninja pkgconfiglite --yes

# Use the pre-installed vcpkg on GitHub Actions
$vcpkgPath = "C:\vcpkg"
if (Test-Path $vcpkgPath) {
echo "Using pre-installed vcpkg at $vcpkgPath"
} else {
echo "Installing fresh vcpkg..."
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
}

# Install required packages
C:\vcpkg\vcpkg.exe install libsodium:x64-windows pkgconf:x64-windows gtest:x64-windows

# Set environment variables
echo "CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV
echo "PKG_CONFIG_PATH=C:/vcpkg/installed/x64-windows/lib/pkgconfig" >> $env:GITHUB_ENV
echo "VCPKG_ROOT=C:/vcpkg" >> $env:GITHUB_ENV

if ("${{ matrix.compiler }}" -eq "msvc") {
echo "Using MSVC compiler"
} else {
echo "Using Clang compiler"
echo "CC=clang" >> $env:GITHUB_ENV
echo "CXX=clang++" >> $env:GITHUB_ENV
}

- name: Install Google Test (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y libgtest-dev
cd /usr/src/gtest
sudo cmake .
sudo make
sudo cp lib/*.a /usr/lib

- name: Install Google Test (macOS)
if: matrix.os == 'macos-latest'
run: |
git clone https://github.com/google/googletest.git
cd googletest
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
cmake --build . --config ${{ matrix.build-type }}
sudo cmake --install . --config ${{ matrix.build-type }}

- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
cd cpp_sdk
New-Item -ItemType Directory -Force -Path build
cd build

# Debug output
echo "CMAKE_TOOLCHAIN_FILE: $env:CMAKE_TOOLCHAIN_FILE"
echo "PKG_CONFIG_PATH: $env:PKG_CONFIG_PATH"
echo "VCPKG_ROOT: $env:VCPKG_ROOT"

if ("${{ matrix.compiler }}" -eq "msvc") {
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_TOOLCHAIN_FILE="$env:CMAKE_TOOLCHAIN_FILE" -DCMAKE_VERBOSE_MAKEFILE=ON
} else {
cmake .. -G"Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DCMAKE_TOOLCHAIN_FILE="$env:CMAKE_TOOLCHAIN_FILE" -DCMAKE_VERBOSE_MAKEFILE=ON
}
env:
CI: true

- name: Configure CMake (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cd cpp_sdk
mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_SANITIZERS=ON
env:
CI: true

- name: Build (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
cd cpp_sdk/build
if ("${{ matrix.compiler }}" -eq "msvc") {
cmake --build . --config ${{ matrix.build-type }}
} else {
ninja
}

- name: Build (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cd cpp_sdk/build
ninja

- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
cd cpp_sdk/build
ctest --verbose --output-on-failure --build-config ${{ matrix.build-type }}

- name: Run tests (Unix)
if: matrix.os != 'windows-latest'
shell: bash
run: |
cd cpp_sdk/build
ctest --verbose --output-on-failure

- name: Generate coverage report (Debug builds only)
if: matrix.build-type == 'Debug' && matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc'
run: |
cd cpp_sdk/build
ninja coverage

- name: Debug coverage files
if: matrix.build-type == 'Debug' && matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc'
run: |
echo "Listing files in cpp_sdk/build:"
ls -la cpp_sdk/build/
echo "Looking for coverage files:"
find cpp_sdk/build/ -name "*.info" -o -name "*.gcno" -o -name "*.gcda" | head -20

- name: Upload coverage to Codecov
if: matrix.build-type == 'Debug' && matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./cpp_sdk/build/coverage.info
flags: cpp_sdk
name: cpp-sdk-coverage
fail_ci_if_error: true

memory-safety:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Clean build directories
run: |
cd cpp_sdk
rm -rf build-asan build-valgrind

- name: Install libsodium
run: sudo apt-get update && sudo apt-get install -y libsodium-dev lcov

- name: Install dependencies
run: |
sudo apt-get install -y cmake ninja-build pkg-config valgrind clang-15
echo "CC=clang-15" >> $GITHUB_ENV
echo "CXX=clang++-15" >> $GITHUB_ENV

- name: Install Google Test
run: |
sudo apt-get install -y libgtest-dev
cd /usr/src/gtest
sudo cmake .
sudo make
sudo cp lib/*.a /usr/lib

- name: Configure with AddressSanitizer
run: |
cd cpp_sdk
mkdir -p build-asan && cd build-asan
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZERS=ON

- name: Build with AddressSanitizer
run: |
cd cpp_sdk/build-asan
ninja

- name: Test with AddressSanitizer
run: |
cd cpp_sdk/build-asan
ninja test-sanitizers

- name: Configure with Valgrind
run: |
cd cpp_sdk
mkdir -p build-valgrind && cd build-valgrind
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_VALGRIND=ON

- name: Build with Valgrind
run: |
cd cpp_sdk/build-valgrind
ninja

- name: Test with Valgrind
run: |
cd cpp_sdk/build-valgrind
ninja test-valgrind

static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install libsodium
run: sudo apt-get update && sudo apt-get install -y libsodium-dev lcov

- name: Install dependencies
run: |
sudo apt-get install -y cmake ninja-build pkg-config clang-15 clang-tidy-15 clang-format-15 # Add clang-format-15 here
echo "CC=clang-15" >> $GITHUB_ENV
echo "CXX=clang++-15" >> $GITHUB_ENV

- name: Install Google Test
run: |
sudo apt-get install -y libgtest-dev
cd /usr/src/gtest
sudo cmake .
sudo make
sudo cp lib/*.a /usr/lib

- name: Configure
run: |
cd cpp_sdk
mkdir build && cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Run clang-tidy
run: |
cd cpp_sdk
clang-tidy-15 src/*.cpp -p build/ --warnings-as-errors=*

- name: Run clang-format check
run: |
cd cpp_sdk
find . -name "*.cpp" -o -name "*.hpp" | grep -v "^./build" | xargs clang-format-15 --dry-run --Werror

documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install libsodium
run: sudo apt-get update && sudo apt-get install -y libsodium-dev lcov

- name: Install dependencies
run: |
sudo apt-get install -y doxygen graphviz libgtest-dev
cd /usr/src/gtest
sudo cmake .
sudo make
sudo cp lib/*.a /usr/lib

- name: Generate documentation
run: |
cd cpp_sdk
mkdir build && cd build
cmake .. -GNinja
ninja docs

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: cpp-sdk-docs
path: cpp_sdk/build/docs/html/
54 changes: 54 additions & 0 deletions cpp_sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Build directories
build/
build-*/
cmake-build-*/
_build/
out/

# Generated files
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile
*.cmake
!CMakeLists.txt
!cmake/*.cmake.in

# Testing
CTestTestfile.cmake
Testing/

# Coverage
*.gcov
*.gcno
*.gcda
coverage.info
coverage_html/

# Documentation
docs/doxygen/html/
docs/doxygen/latex/
docs/doxygen/xml/

# Compiled binaries
*.a
*.so
*.dylib
*.dll
*.exe

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS files
.DS_Store
Thumbs.db

# Temporary files
*.tmp
*.temp
/tmp/
Loading
Loading