[fix:project] Another update CI\CD #11
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: Python Code Validator CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest ] | |
| python-version: [ "3.11" ] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| # 1. Настройка Python | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # 2. Установка uv | |
| - name: Install uv | |
| run: pip install uv | |
| # 3. Создание venv и установка зависимостей | |
| - name: Create venv and install dependencies | |
| run: | | |
| uv venv | |
| uv pip install -e ".[dev]" | |
| # 4. Запуск проверок (единый шаг для всех ОС) | |
| - name: Run Linting and Tests | |
| run: | | |
| echo "--- Running Lint and Format Check ---" | |
| uv run ruff check src/ tests/ | |
| uv run ruff format --check src/ tests/ | |
| echo "--- Running Tests with Coverage ---" | |
| uv run coverage run -m unittest discover tests | |
| # 5. Загрузка отчета | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true |