mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-02-03 18:45:32 +08:00
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: Code Coverage
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "main"
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
fail-fast: false
|
|
env:
|
|
OS: ${{ matrix.os }}
|
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
enable-cache: true
|
|
cache-suffix: ${{ env.PYTHON_VERSION }}_${{ env.OS }}
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
uv python pin ${{ env.PYTHON_VERSION }}
|
|
uv sync --group test
|
|
|
|
- name: Run tests
|
|
run: uv run pytest --cov=nonebot_plugin_tetris_stats --cov-report xml
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
env_vars: OS,PYTHON_VERSION
|
|
|
|
check:
|
|
if: always()
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
uses: re-actors/alls-green@2765efec08f0fd63e83ad900f5fd75646be69ff6
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|