2021-12-10 09:01:56 +00:00
|
|
|
name: Code Coverage
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-01-28 06:02:27 +00:00
|
|
|
branches:
|
|
|
|
- master
|
2021-12-10 09:01:56 +00:00
|
|
|
pull_request:
|
2023-01-04 04:48:10 +00:00
|
|
|
paths:
|
2024-01-26 03:12:57 +00:00
|
|
|
- "envs/**"
|
2023-01-04 04:48:10 +00:00
|
|
|
- "nonebot/**"
|
|
|
|
- "packages/**"
|
|
|
|
- "tests/**"
|
2023-11-08 02:30:00 +00:00
|
|
|
- ".github/actions/setup-python/**"
|
|
|
|
- ".github/workflows/codecov.yml"
|
|
|
|
- "pyproject.toml"
|
|
|
|
- "poetry.lock"
|
2021-12-10 09:01:56 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2022-01-13 10:11:00 +00:00
|
|
|
name: Test Coverage
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-02-16 06:17:33 +00:00
|
|
|
concurrency:
|
2024-01-26 03:12:57 +00:00
|
|
|
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.env }}
|
2022-02-16 06:17:33 +00:00
|
|
|
cancel-in-progress: true
|
2022-01-13 09:58:35 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-04-15 16:33:48 +00:00
|
|
|
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
2022-01-13 09:58:35 +00:00
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2024-01-26 03:12:57 +00:00
|
|
|
env: [pydantic-v1, pydantic-v2]
|
2022-01-13 09:58:35 +00:00
|
|
|
fail-fast: false
|
2022-01-13 10:11:00 +00:00
|
|
|
env:
|
|
|
|
OS: ${{ matrix.os }}
|
|
|
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
2024-01-26 03:12:57 +00:00
|
|
|
PYDANTIC_VERSION: ${{ matrix.env }}
|
2022-01-13 09:58:35 +00:00
|
|
|
|
2021-12-10 09:01:56 +00:00
|
|
|
steps:
|
2023-09-05 04:00:44 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-10 09:01:56 +00:00
|
|
|
|
2022-01-13 08:41:01 +00:00
|
|
|
- name: Setup Python environment
|
|
|
|
uses: ./.github/actions/setup-python
|
2022-01-13 09:58:35 +00:00
|
|
|
with:
|
2022-01-13 10:06:07 +00:00
|
|
|
python-version: ${{ matrix.python-version }}
|
2024-01-26 03:12:57 +00:00
|
|
|
env-dir: ./envs/${{ matrix.env }}
|
|
|
|
no-root: true
|
2021-12-20 02:10:22 +00:00
|
|
|
|
|
|
|
- name: Run Pytest
|
2021-12-10 09:01:56 +00:00
|
|
|
run: |
|
2024-01-26 03:12:57 +00:00
|
|
|
cd ./envs/${{ matrix.env }}
|
|
|
|
poetry run bash "../../scripts/run-tests.sh"
|
2021-12-10 09:01:56 +00:00
|
|
|
|
|
|
|
- name: Upload coverage report
|
2024-02-01 05:59:22 +00:00
|
|
|
uses: codecov/codecov-action@v4
|
2021-12-10 09:01:56 +00:00
|
|
|
with:
|
2024-01-26 03:12:57 +00:00
|
|
|
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
|
2021-12-10 09:01:56 +00:00
|
|
|
files: ./tests/coverage.xml
|
|
|
|
flags: unittests
|
2024-02-01 05:59:22 +00:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|