docs: 增加回调函数,可在处理各类消息、新连接和连接断开时调用 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Coverage | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- dev | |
paths: | |
- ".github/actions/setup-python/**" | |
- ".github/workflows/codecov.yml" | |
- "pydglab_ws/**" | |
- "tests/**" | |
- "pyproject.toml" | |
- "poetry.lock" | |
pull_request: | |
paths: | |
- ".github/actions/setup-python/**" | |
- ".github/workflows/codecov.yml" | |
- "pydglab_ws/**" | |
- "tests/**" | |
- "pyproject.toml" | |
- "poetry.lock" | |
jobs: | |
test: | |
name: Test With Coverage | |
runs-on: ${{ matrix.os }} | |
concurrency: | |
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }} | |
cancel-in-progress: true | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-14 aka. macos-latest has switched to being an ARM runner, only supporting newer versions of Python. | |
# https://github.com/actions/setup-python/issues/855#issuecomment-2096792205 | |
os: [ubuntu-latest, windows-latest, macos-13] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
include: # Use macos-latest here because it seems that Pydantic currently not support macOS ARM64 on 3.11, 3.12 | |
- os: macos-latest | |
python-version: "3.11" | |
- os: macos-latest | |
python-version: "3.12" | |
exclude: | |
- os: macos-13 | |
python-version: "3.11" | |
- os: macos-13 | |
python-version: "3.12" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python environment | |
uses: ./.github/actions/setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Run Pytest | |
run: | | |
poetry run pytest -v --capture=sys --cov --cov-report=xml tests/ | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: coverage.xml | |
flags: ${{ matrix.os }}-${{ matrix.python-version }} |