Skip to content

feat: Phase 3-6 - backpressure, timeouts, CI benchmark #2

feat: Phase 3-6 - backpressure, timeouts, CI benchmark

feat: Phase 3-6 - backpressure, timeouts, CI benchmark #2

Workflow file for this run

name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
permissions:
contents: read
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Debug, Release]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up CMake
uses: lukka/get-cmake@latest
- name: Configure CMake
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DEWSS_BUILD_TESTS=ON \
-DEWSS_BUILD_EXAMPLES=ON
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} -j
- name: Run Tests
working-directory: build
run: ctest -C ${{ matrix.build_type }} --output-on-failure --verbose
build-no-exceptions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up CMake
uses: lukka/get-cmake@latest
- name: Configure CMake (no exceptions/RTTI)
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DEWSS_BUILD_TESTS=ON \
-DEWSS_BUILD_EXAMPLES=OFF \
-DEWSS_NO_EXCEPTIONS=ON
- name: Build
run: cmake --build build --config Release -j
- name: Run Tests
working-directory: build
run: ctest -C Release --output-on-failure
sanitizers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer:
- address
- undefined
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang
- name: Set up CMake
uses: lukka/get-cmake@latest
- name: Configure CMake with ${{ matrix.sanitizer }} sanitizer
env:
CC: clang
CXX: clang++
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DEWSS_BUILD_TESTS=ON \
-DEWSS_BUILD_EXAMPLES=OFF \
-DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-omit-frame-pointer" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitizer }}"
- name: Build
run: cmake --build build -j
- name: Run Tests
working-directory: build
run: ctest --output-on-failure
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cpplint
run: pip install cpplint
- name: Run cpplint
run: |
find include src tests examples \
\( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) -print0 \
| xargs -0 cpplint --filter=-build/c++11,-legal/copyright,-readability/todo,-build/include_subdir 2>&1 || true
- name: Check clang-format
run: |
sudo apt-get update && sudo apt-get install -y clang-format
find include src tests \
\( -name '*.h' -o -name '*.hpp' -o -name '*.cpp' \) -print0 \
| xargs -0 clang-format --dry-run --Werror 2>&1 || true
benchmark:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v4
- name: Set up CMake
uses: lukka/get-cmake@latest
- name: Build Release
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DEWSS_BUILD_TESTS=OFF \
-DEWSS_BUILD_EXAMPLES=ON
cmake --build build --config Release -j
- name: Run Benchmark (single client, 64B)
run: |
timeout 60 ./build/benchmark_echo 1 5000 64 || true
- name: Run Benchmark (4 clients, 64B)
run: |
timeout 60 ./build/benchmark_echo 4 5000 64 || true
- name: Run Benchmark (payload sweep)
run: |
for size in 8 64 128 512 1024; do
echo "=== Payload: ${size}B ==="
timeout 60 ./build/benchmark_echo 1 5000 $size || true
done