Skip to content

MCTS Optimization: Added Redis caching and metrics tracking #8

MCTS Optimization: Added Redis caching and metrics tracking

MCTS Optimization: Added Redis caching and metrics tracking #8

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction --no-root
- name: Run tests with coverage
run: |
poetry run pytest --cov=app --cov-report=term-missing --cov-report=html --cov-fail-under=95
env:
PYTHONPATH: ${{ github.workspace }}
ENVIRONMENT: test
LLM_API_KEY: test-api-key
LLM_API_BASE_URL: https://api.openai.com/v1
LLM_MODEL_NAME: gpt-4
EMBEDDING_MODEL_API_KEY: test-api-key
EMBEDDING_MODEL_BASE_URL: https://api.openai.com/v1
EMBEDDING_MODEL_NAME: text-embedding-3-large
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: test_db
DB_USER: test
DB_SECRET: test
LOG_LEVEL: INFO
LLM_TIMEOUT_SECONDS: 600
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: htmlcov/
- name: Run ruff linting
run: |
poetry run ruff check .
poetry run ruff format --check .