From 10461e6a294cc0a48582cf7cedc29e368e2a5e4f Mon Sep 17 00:00:00 2001 From: Kris <2893855659@qq.com> Date: Tue, 12 May 2026 00:57:35 +0800 Subject: [PATCH] ci(github-actions): add test workflow for backend python code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增GitHub Actions测试工作流,在push和pull request到main分支且后端Python文件变更时运行后端单元测试 --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..0cb6550e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test + +on: + push: + branches: [main] + paths: + - 'backend/**/*.py' + pull_request: + branches: [main] + +jobs: + test-channels: + runs-on: ubuntu-latest + defaults: + run: + working-directory: backend + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.7.2" + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install dependencies + run: uv sync --group test + + - name: Run channel gateway tests + run: uv run pytest test/unit/channels/ -v --tb=short \ No newline at end of file