ci: harden quality gates and clean test warnings

This commit is contained in:
胡绍康 committed 2026-03-10 22:04:18 +08:00
1 parent 1d4d848702
commit bd9bafeb83
10 files changed
+359 -63

No files matched your search

+19 -4
View File
@@ -5,14 +5,20 @@ on:
branches: [ "main", "master" ]
paths:
- "**.py"
- "pyproject.toml"
- "requirements.txt"
- "tests/**"
- "templates/**"
- "static/**"
- ".github/workflows/python-tests.yml"
pull_request:
paths:
- "**.py"
- "pyproject.toml"
- "requirements.txt"
- "tests/**"
- "templates/**"
- "static/**"
- ".github/workflows/python-tests.yml"
workflow_dispatch:
@@ -37,12 +43,21 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install coverage
- name: Syntax check
run: |
python -m py_compile web_outlook_app.py
python -m py_compile outlook_mail_reader.py
python -m compileall -q outlook_web web_outlook_app.py outlook_mail_reader.py start.py tests
- name: Run unit tests
run: python -m unittest discover -s tests -v
- name: Run unit tests with coverage
run: |
coverage run -m unittest discover -s tests -v
coverage xml
coverage report
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-python-${{ matrix.python-version }}
path: coverage.xml