nonebot2/.github/workflows/codecov.yml

59 lines
1.5 KiB
YAML
Raw Normal View History

2021-12-10 09:01:56 +00:00
name: Code Coverage
on:
push:
branches:
- master
2021-12-10 09:01:56 +00:00
pull_request:
paths:
- "envs/**"
- "nonebot/**"
- "packages/**"
- "tests/**"
- ".github/actions/setup-python/**"
- ".github/workflows/codecov.yml"
- "pyproject.toml"
- "poetry.lock"
2021-12-10 09:01:56 +00:00
jobs:
test:
name: Test Coverage
runs-on: ${{ matrix.os }}
concurrency:
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.env }}
cancel-in-progress: true
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
env: [pydantic-v1, pydantic-v2]
fail-fast: false
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
PYDANTIC_VERSION: ${{ matrix.env }}
2021-12-10 09:01:56 +00:00
steps:
- uses: actions/checkout@v4
2021-12-10 09:01:56 +00:00
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
2022-01-13 10:06:07 +00:00
python-version: ${{ matrix.python-version }}
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: |
cd ./envs/${{ matrix.env }}
poetry run bash "../../scripts/run-tests.sh"
2021-12-10 09:01:56 +00:00
- name: Upload coverage report
uses: codecov/codecov-action@v4
2021-12-10 09:01:56 +00:00
with:
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
2021-12-10 09:01:56 +00:00
files: ./tests/coverage.xml
flags: unittests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}