From b0ae0f71c82268ab155d5ee86842b4f8b264b991 Mon Sep 17 00:00:00 2001 From: xfy911 Date: Sat, 6 Jun 2026 18:08:17 +0800 Subject: [PATCH] =?UTF-8?q?ci(github):=20=E6=B7=BB=E5=8A=A0=20GitHub=20Act?= =?UTF-8?q?ions=20=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 push/PR 时自动编译和运行测试 - 安装 Ubuntu 依赖:liburing-dev libz-dev libbrotli-dev libssl-dev libnghttp2-dev - 构建 coco submodule、编译 cocoon、运行单元测试和集成测试 - 可选运行性能基准(wrk) --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e07fb20 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake \ + liburing-dev libz-dev \ + libbrotli-dev libssl-dev \ + libnghttp2-dev + + - name: Build coco + run: | + cd coco + mkdir -p build && cd build + cmake .. + make -j$(nproc) + + - name: Build cocoon + run: make + + - name: Run unit tests + run: make unit-test + + - name: Run integration tests + run: make test + + - name: Run benchmark + run: | + # 安装 wrk + sudo apt-get install -y wrk || true + make bench || true