ci(github-actions): add test workflow for backend python code
新增GitHub Actions测试工作流,在push和pull request到main分支且后端Python文件变更时运行后端单元测试
This commit is contained in:
parent
fd78c04f9d
commit
10461e6a29
34
.github/workflows/test.yml
vendored
Normal file
34
.github/workflows/test.yml
vendored
Normal file
@ -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
|
||||
Loading…
Reference in New Issue
Block a user