From 0393366d6c1a053c44dd36aae79ff57975ba6b60 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Sat, 11 Jul 2026 20:57:09 +0800 Subject: [PATCH 1/2] ci: compile tcp benchmarks on pull requests --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dc1f623..44dbfb3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: runs-on: ubuntu-latest outputs: code: ${{ steps.filter.outputs.code }} + tcp_benchmark: ${{ steps.filter.outputs.tcp_benchmark }} steps: - name: Checkout repository uses: actions/checkout@v7 @@ -34,6 +35,15 @@ jobs: - 'cmake/**' - 'tools/**' - '.github/workflows/**' + tcp_benchmark: + - 'include/**' + - 'examples/bench_tcp_*.cpp' + - 'examples/bench_tcp_common.hpp' + - 'examples/CMakeLists.txt' + - 'CMakeLists.txt' + - '*.cmake' + - 'cmake/**' + - '.github/workflows/**' build-and-test: needs: changes @@ -248,3 +258,49 @@ jobs: -DCMAKE_CXX_COMPILER=g++-14 \ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/_install cmake --build consumer/build --parallel + + tcp-benchmark-compile: + needs: changes + runs-on: ubuntu-24.04 + name: tcp-benchmark-compile + + steps: + - name: Skip TCP benchmark compile + if: needs.changes.outputs.tcp_benchmark != 'true' + run: echo "No TCP benchmark-affecting changes detected; compile check intentionally skipped." + + - name: Checkout repository + if: needs.changes.outputs.tcp_benchmark == 'true' + uses: actions/checkout@v7 + + - name: Install dependencies + if: needs.changes.outputs.tcp_benchmark == 'true' + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + ninja-build \ + liburing-dev \ + libuv1-dev \ + g++-14 + + - name: Configure TCP benchmark build + if: needs.changes.outputs.tcp_benchmark == 'true' + run: | + cmake -B build-tcp-benchmark -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=gcc-14 \ + -DCMAKE_CXX_COMPILER=g++-14 \ + -DELIO_BUILD_TESTS=OFF \ + -DELIO_BUILD_EXAMPLES=ON \ + -DELIO_ENABLE_TLS=OFF \ + -DELIO_ENABLE_HTTP=OFF \ + -DELIO_ENABLE_HTTP2=OFF \ + -DELIO_BUILD_TCP_BENCHMARKS=ON + + - name: Build TCP benchmark targets + if: needs.changes.outputs.tcp_benchmark == 'true' + run: | + cmake --build build-tcp-benchmark \ + --target bench_tcp_elio bench_tcp_libuv bench_tcp_asio \ + --parallel 2 From e5bf19629c8d8e520eb86a421196a2386f8fc067 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Sat, 11 Jul 2026 20:59:29 +0800 Subject: [PATCH 2/2] docs: mention tcp benchmark compile checks --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e301f430..a7267596 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -147,7 +147,7 @@ perf(runtime): add alignas(64) to worker_thread hot fields 2. **Description**: explain *what* changed and *why*. Reference related issues. 3. **CI must pass**: all required GitHub Actions checks, including matrix builds (x64/arm64, Release/Debug), ASAN/TSAN, release benchmarks, and the - package-consumer check. + package-consumer and TCP benchmark compile checks. 4. **One logical change per PR**: keep PRs focused. Split unrelated changes. 5. **Breaking changes**: clearly document in the PR description and prefix the commit with `!` (e.g., `fix(sync)!: make channel non-movable`).