Skip to content

Github: CI

Github: CI #17

name: AI Platform CI
on:
push:
branches: [staging]
pull_request:
branches: [staging]
jobs:
checks:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ai_platform
ports:
- 5432:5432
options: --health-cmd "pg_isready -U ai_platform" --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python-version: ["3.11.7"]
redis-version: [6]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Making env file
run: cp envSample .env
- name: Install uv
uses: astral-sh/setup-uv@v5
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 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
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- name: Check coverage percentage
run: |
coverage report --fail-under=70
working-directory: backend