Skip to content

Integration Tests #1931

Integration Tests

Integration Tests #1931

name: Integration Tests
on:
push:
branches: [ main, develop, 'phase*' ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC
permissions:
contents: read
pull-requests: write
issues: write
checks: write
jobs:
integration-tests:
if: github.ref != 'refs/heads/gh-pages'
name: Run Integration Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Checkout common_system
uses: actions/checkout@v6
with:
repository: kcenon/common_system
path: common_system
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Build Environment (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build libasio-dev libfmt-dev lcov
- name: Setup Build Environment (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install cmake ninja asio fmt lcov
- name: Install common_system headers (Unix)
if: ${{ !startsWith(matrix.os, 'windows') }}
shell: bash
run: |
# common_system is header-only, install headers after build tools are available
if [ -d "common_system" ]; then
echo "Installing common_system headers..."
cd common_system
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SAMPLES=OFF
cmake --build build
sudo cmake --install build --prefix /usr/local
cd ..
fi
- name: Setup Build Environment (Windows)
if: startsWith(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
update: true
msystem: MINGW64
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-asio
mingw-w64-x86_64-fmt
mingw-w64-x86_64-gcc
- name: Install common_system headers (Windows)
if: startsWith(matrix.os, 'windows')
shell: msys2 {0}
run: |
if [ -d "common_system" ]; then
echo "Installing common_system headers..."
cd common_system
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SAMPLES=OFF
cmake --build build
cmake --install build --prefix /mingw64
cd ..
fi
- name: Configure CMake (Windows)
if: startsWith(matrix.os, 'windows')
shell: msys2 {0}
run: |
# Ensure all tools are in PATH
export PATH="/mingw64/bin:$PATH"
# Verify tools are available
which gcc
which g++
which ninja || echo "Ninja not found"
# Configure with compilers in PATH (avoid path translation issues)
cmake -B build -G "Ninja" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_WITH_COMMON_SYSTEM=ON \
-DBUILD_WITH_LOGGER_SYSTEM=OFF \
-DBUILD_WITH_THREAD_SYSTEM=OFF \
-DBUILD_WITH_CONTAINER_SYSTEM=OFF \
-DBUILD_MESSAGING_BRIDGE=OFF \
-DBUILD_TESTS=ON \
-DBUILD_SAMPLES=OFF \
-DENABLE_COVERAGE=OFF
- name: Configure CMake (Unix)
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_WITH_COMMON_SYSTEM=ON \
-DBUILD_WITH_LOGGER_SYSTEM=OFF \
-DBUILD_WITH_THREAD_SYSTEM=OFF \
-DBUILD_WITH_CONTAINER_SYSTEM=OFF \
-DBUILD_MESSAGING_BRIDGE=OFF \
-DBUILD_TESTS=ON \
-DBUILD_SAMPLES=OFF \
-DENABLE_COVERAGE=${{ matrix.build_type == 'Debug' && 'ON' || 'OFF' }}
- name: Build (Windows)
if: startsWith(matrix.os, 'windows')
shell: msys2 {0}
run: cmake --build build --config ${{ matrix.build_type }}
- name: Build (Unix)
if: ${{ !startsWith(matrix.os, 'windows') }}
run: cmake --build build --config ${{ matrix.build_type }}
- name: Run Unit Tests
run: |
cd build
ctest --output-on-failure --timeout 60
continue-on-error: true
- name: Run E2E Tests
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
cd build
if [ -f ./test_e2e ]; then
./test_e2e || true
elif [ -f ./bin/test_e2e ]; then
./bin/test_e2e || true
else
echo "test_e2e not found, skipping"
fi
continue-on-error: true
- name: Run Stress Tests (Release only)
if: matrix.build_type == 'Release' && !startsWith(matrix.os, 'windows')
run: |
cd build
if [ -f ./stress_test ]; then
./stress_test 20 100 10 || true
elif [ -f ./bin/stress_test ]; then
./bin/stress_test 20 100 10 || true
else
echo "stress_test not found, skipping"
fi
continue-on-error: true
- name: Run Performance Benchmark (Release only)
if: matrix.build_type == 'Release' && !startsWith(matrix.os, 'windows')
run: |
cd build
if [ -f ./benchmark ]; then
./benchmark || true
elif [ -f ./bin/benchmark ]; then
./bin/benchmark || true
else
echo "benchmark not found, skipping"
fi
continue-on-error: true
- name: Generate Coverage Report (Debug only)
if: matrix.build_type == 'Debug' && startsWith(matrix.os, 'ubuntu')
run: |
cd build
# Use geninfo directly with error ignoring for known GCC issues
geninfo . --output-filename coverage.info --ignore-errors negative --ignore-errors mismatch || \
lcov --capture --directory . --output-file coverage.info --ignore-errors negative,unused || \
echo "Coverage generation failed, continuing..."
# Try to clean coverage data if it exists
if [ -f coverage.info ]; then
lcov --remove coverage.info '/usr/*' --output-file coverage.info --ignore-errors unused || true
lcov --list coverage.info || true
fi
- name: Upload Coverage to Codecov
if: matrix.build_type == 'Debug' && startsWith(matrix.os, 'ubuntu')
uses: codecov/codecov-action@v6
with:
file: ./build/coverage.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
# Continue even if artifact upload fails due to GitHub infrastructure issues
# This prevents transient upload timeouts from failing the entire workflow
continue-on-error: true
with:
name: test-results-${{ matrix.os }}-${{ matrix.build_type }}
path: |
build/Testing/
build/*.log
retention-days: 7