fix: Resolve pre-commit and coverage issues #8
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: Code Coverage | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| env: | |
| BOT_TOKEN: test-token | |
| MINDEE_API_KEY: test-key | |
| MINDEE_MODEL_ID: test-model | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[dev] | |
| - name: Run DB migrations | |
| run: python -m alembic upgrade head | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=. --cov-report=xml --cov-report=term-missing \ | |
| --cov-fail-under=80 --import-mode=importlib | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| fail_ci_if_error: false |