Skip to content

fix: 解决 Windows 休眠或息屏后应用被异常终止的问题 #26

fix: 解决 Windows 休眠或息屏后应用被异常终止的问题

fix: 解决 Windows 休眠或息屏后应用被异常终止的问题 #26

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
paths:
- "src/**"
- "tests/**"
- "pyproject.toml"
- ".github/workflows/**"
jobs:
ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.11"
version: latest
- name: Ruff check
run: uvx ruff check --output-format=github .
- name: Ruff format check
run: uvx ruff format --check .
basedpyright:
name: BasedPyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.11"
version: "latest"
- name: Install Dependencies
run: uv sync
- name: Static typing check
run: uvx basedpyright
test:
name: Coverage
runs-on: windows-latest
permissions:
id-token: write
contents: read
concurrency:
# group: test-coverage-${{ github.ref }}-${{ matrix.python-version }}-${{ matrix.os }}
group: coverage-${{ github.ref }}-${{ matrix.python-version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
# os: [ubuntu-latest, windows-latest, macos-latest]
# pydantic-version: ["v1", "v2"]
env:
# OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
UV_NO_SYNC: 1
steps:
- uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
version: latest
- name: Install Dependencies
run: uv sync
- name: Run Pytest
run: uv run pytest --cov=src --cov-report xml --junitxml=./junit.xml -n auto
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
use_oidc: true
report_type: test_results
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
use_oidc: true