Kaapi v1.0: Enhancing the test suite #1687
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: Kaapi CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| checks: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: ai_platform_test | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5 | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| redis-version: [6] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Making env file | |
| run: | | |
| cp .env.test.example .env | |
| cp .env.test.example .env.test | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.4.15" | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync | |
| working-directory: backend | |
| - name: Activate virtual environment and run Alembic migrations | |
| run: | | |
| source .venv/bin/activate | |
| alembic upgrade head | |
| working-directory: backend | |
| - name: Run pre-commit | |
| run: | | |
| source .venv/bin/activate | |
| uv run pre-commit run --all-files | |
| working-directory: backend | |
| - name: Run tests | |
| run: uv run bash scripts/tests-start.sh "Coverage for ${{ github.sha }}" | |
| working-directory: backend | |
| - name: Upload coverage reports to codecov | |
| uses: codecov/codecov-action@v5.5.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| - name: Check coverage percentage | |
| run: | | |
| source .venv/bin/activate | |
| coverage report --fail-under=70 | |
| working-directory: backend |