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