From 8a7fa351ac25d918036acf6562aaa884a736aa93 Mon Sep 17 00:00:00 2001 From: Denny991 <997991021@qq.com> Date: Mon, 8 Jun 2026 16:31:39 +0800 Subject: [PATCH] ci: add GitHub Actions workflow and make ci target --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ Makefile | 4 +++- README.md | 8 +++++++- pyproject.toml | 2 ++ 4 files changed, 39 insertions(+), 2 deletions(-) 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..b0e355b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: pip + + - name: Install dependencies + run: pip install -e ".[dev]" + + - name: CI + run: make ci diff --git a/Makefile b/Makefile index 697bead..080e7ef 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help format lint check fix type-check test clean pre-commit-install pre-commit-run +.PHONY: help format lint check fix type-check test ci clean pre-commit-install pre-commit-run help: ## Show this help message @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' @@ -49,4 +49,6 @@ clean: ## Remove build artifacts and caches # ==================== All-in-one ==================== +ci: check type-check test ## CI pipeline (check only, no file modification) + all: fix format type-check test ## Fix, format, type-check, and test diff --git a/README.md b/README.md index 25a12c3..c51ecbf 100644 --- a/README.md +++ b/README.md @@ -369,10 +369,16 @@ make type-check # Run tests make test -# Run all checks +# Run all checks (local: auto-fix + test) make all + +# CI-equivalent checks (no auto-fix; same as GitHub Actions) +make ci ``` +Before opening a pull request, run `make ci`. GitHub Actions runs the same +lint, format, type-check, and test checks on pull requests to `main`. + The test suite lives under `tests/` and covers backend contracts, routing strategies, service discovery, health checks, and PD executors. diff --git a/pyproject.toml b/pyproject.toml index 3b4b32a..53ce747 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,8 @@ dependencies = [ "shortuuid>=1.0.0", "fire>=0.5.0", "pyyaml>=6.0", + "msgpack>=1.0.0", + "pyzmq>=25.0.0", ] [project.optional-dependencies]