mirror of
https://github.com/moesnow/March7thAssistant.git
synced 2026-08-02 18:24:16 +08:00
ci: 添加测试 CI workflow
This commit is contained in:
parent
ba0be136cb
commit
11d937258e
7
.github/workflows/2.realtime_release.yml
vendored
7
.github/workflows/2.realtime_release.yml
vendored
@ -4,8 +4,13 @@ name: Build realtime release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "**.py"
|
||||
- "**/*.py"
|
||||
- "requirements.txt"
|
||||
- "pyproject.toml"
|
||||
- "uv.lock"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
2
.github/workflows/7.close_quality_pr.yml
vendored
2
.github/workflows/7.close_quality_pr.yml
vendored
@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
if: "${{ startsWith(github.event.pull_request.title, '✨ Quality: ') }}"
|
||||
if: "${{ startsWith(github.event.pull_request.title, '✨ Quality: ') || startsWith(github.event.pull_request.title, 'Security: ') }}"
|
||||
steps:
|
||||
- name: Close pull request
|
||||
uses: actions/github-script@v9
|
||||
|
||||
44
.github/workflows/8.test.yml
vendored
Normal file
44
.github/workflows/8.test.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "**/*.py"
|
||||
- "requirements.txt"
|
||||
- "pyproject.toml"
|
||||
- "uv.lock"
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "**/*.py"
|
||||
- "requirements.txt"
|
||||
- "pyproject.toml"
|
||||
- "uv.lock"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up uv
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
version: "0.11.15"
|
||||
python-version: "3.14.5"
|
||||
enable-cache: true
|
||||
cache-python: true
|
||||
prune-cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync --group dev
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest tests/ -v --tb=short
|
||||
Loading…
x
Reference in New Issue
Block a user