при ошибке удаления не выкидывать войс из отслеживаемых #28
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| cache: pip | |
| cache-dependency-path: requirements.txt | |
| - name: install deps | |
| run: | | |
| python -m pip install --upgrade pip --disable-pip-version-check | |
| pip install -r requirements.txt | |
| pip install ruff | |
| - name: cache lint | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ruff_cache | |
| key: lint-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-${{ github.sha }} | |
| restore-keys: | | |
| lint-${{ runner.os }}-${{ hashFiles('requirements.txt') }}- | |
| - name: ruff check | |
| run: ruff check . | |
| - name: ruff format | |
| if: always() | |
| run: ruff format --check . | |
| # mypy выпилен: давал 32 ошибки в 10 файлах (в основном implicit Optional | |
| # в slash-командах и union-attr на discord.py каналах). Запускать с `|| true` | |
| # бессмысленно — CI всегда зелёный и баги не ловит. Чтобы реально включить, | |
| # надо: пройтись по cogs/, заменить `member: discord.Member = None` на | |
| # `Member | None = None`, типизировать кастомные атрибуты CoolBot | |
| # (webhook_service, command_cooldown), и расставить isinstance-guard'ы | |
| # или assert'ы для channel.send() где канал может быть None/ForumChannel. | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: requirements.txt | |
| - name: install deps | |
| run: | | |
| python -m pip install --upgrade pip --disable-pip-version-check | |
| pip install -r requirements.txt | |
| pip install pytest pytest-asyncio pytest-cov | |
| - name: tests | |
| run: pytest tests/ -v --cov=. --cov-report=xml --cov-report=term | |
| - name: upload coverage | |
| if: matrix.python-version == '3.13' && success() | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| fail_ci_if_error: false |