-
-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (54 loc) · 1.45 KB
/
Copy pathtest.yml
File metadata and controls
62 lines (54 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Run Tests
on:
schedule:
# 每天UTC时间0点运行(北京时间8点)
- cron: "0 0 * * *"
workflow_dispatch:
push:
branches: ["dev"]
paths:
- 'src/**/*.py'
- 'tests/**/*.py'
- '.github/workflows/test.yml'
- 'pyproject.toml'
jobs:
test:
strategy:
matrix:
include:
- python-version: '3.10'
os: ubuntu-latest
- python-version: '3.11'
os: windows-latest
- python-version: '3.12'
os: macos-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync
- name: Run tests with unittest
working-directory: tests
env:
PYTHONIOENCODING: utf-8
run: uv run python -m unittest discover -v
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
jmcomic_ai.log
tests/jmcomic_ai.log
if-no-files-found: ignore