Fix backend ci caching (#1490) #2456
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: backend | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - 'master' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_USER: bracket_ci | |
| POSTGRES_PASSWORD: bracket_ci | |
| POSTGRES_DB: bracket_ci | |
| ports: | |
| - 5532:5432 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: python3 -m pip install --upgrade uv wheel virtualenv | |
| working-directory: backend | |
| - id: cache-uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/uv | |
| key: ${{ runner.os }}-uv | |
| - name: Run tests | |
| run: uv run pytest --cov --cov-report=xml . | |
| working-directory: backend | |
| env: | |
| ENVIRONMENT: CI | |
| - name: Upload coverage report to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Run mypy | |
| run: uv run mypy --version && uv run mypy . | |
| working-directory: backend | |
| - name: Run pyrefly | |
| run: uv run pyrefly --version && uv run pyrefly check | |
| working-directory: backend | |
| - name: Run pylint | |
| run: uv run pylint bracket tests cli.py | |
| working-directory: backend | |
| - name: Run ruff format | |
| run: uv run ruff format --check . | |
| working-directory: backend | |
| - name: Run ruff | |
| run: uv run ruff check . | |
| working-directory: backend | |
| - name: Run vulture | |
| run: '! uv run vulture |grep "unused function\|unused class\|unused method"' | |
| working-directory: backend |