2021-12-10 17:01:56 +08:00
|
|
|
name: Code Coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-01-28 14:02:27 +08:00
|
|
|
branches:
|
|
|
|
- master
|
2021-12-10 17:01:56 +08:00
|
|
|
pull_request:
|
2023-01-04 12:48:10 +08:00
|
|
|
paths:
|
|
|
|
- "nonebot/**"
|
|
|
|
- "packages/**"
|
|
|
|
- "tests/**"
|
2021-12-10 17:01:56 +08:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2022-01-13 18:11:00 +08:00
|
|
|
name: Test Coverage
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-02-16 14:17:33 +08:00
|
|
|
concurrency:
|
2022-02-16 14:41:39 +08:00
|
|
|
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
|
2022-02-16 14:17:33 +08:00
|
|
|
cancel-in-progress: true
|
2022-01-13 17:58:35 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-04 09:29:13 +08:00
|
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
2022-01-13 17:58:35 +08:00
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
fail-fast: false
|
2022-01-13 18:11:00 +08:00
|
|
|
env:
|
|
|
|
OS: ${{ matrix.os }}
|
|
|
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
2022-01-13 17:58:35 +08:00
|
|
|
|
2021-12-10 17:01:56 +08:00
|
|
|
steps:
|
2023-09-05 12:00:44 +08:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-10 17:01:56 +08:00
|
|
|
|
2022-01-13 16:41:01 +08:00
|
|
|
- name: Setup Python environment
|
|
|
|
uses: ./.github/actions/setup-python
|
2022-01-13 17:58:35 +08:00
|
|
|
with:
|
2022-01-13 18:06:07 +08:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2021-12-20 10:10:22 +08:00
|
|
|
|
|
|
|
- name: Run Pytest
|
2021-12-10 17:01:56 +08:00
|
|
|
run: |
|
|
|
|
cd tests/
|
2022-01-10 11:53:02 +08:00
|
|
|
poetry run pytest -n auto --cov-report xml
|
2021-12-10 17:01:56 +08:00
|
|
|
|
|
|
|
- name: Upload coverage report
|
2022-04-06 20:18:44 +08:00
|
|
|
uses: codecov/codecov-action@v3
|
2021-12-10 17:01:56 +08:00
|
|
|
with:
|
2022-01-13 18:11:00 +08:00
|
|
|
env_vars: OS,PYTHON_VERSION
|
2021-12-10 17:01:56 +08:00
|
|
|
files: ./tests/coverage.xml
|
|
|
|
flags: unittests
|