Skip to content

feat(memory): OTTO remembers conversations #25

feat(memory): OTTO remembers conversations

feat(memory): OTTO remembers conversations #25

Workflow file for this run

name: CI
on:
push:
branches: [master, main, develop]
pull_request:
branches: [master, main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.11"
jobs:
# ===========================================================================
# Unit Tests (Matrix)
# ===========================================================================
test:
name: Tests (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,test]"
- name: Run tests
run: python -m pytest tests/ -v --tb=short -q --junitxml=test-results.xml
timeout-minutes: 30
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
path: test-results.xml
# ===========================================================================
# Coverage Report
# ===========================================================================
coverage:
name: Coverage Report
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
- name: Install dependencies
run: |
pip install -e ".[dev,test]"
pip install pytest-cov
- name: Run tests with coverage
run: python -m pytest tests/ --cov=src/otto --cov-report=xml --cov-report=term-missing -q
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: coverage.xml
fail_ci_if_error: false
continue-on-error: true
# ===========================================================================
# Lint & Type Check
# ===========================================================================
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install linters
run: pip install ruff black isort mypy
- name: Run Ruff linter
run: ruff check src/ --output-format=github || true
continue-on-error: true
- name: Check formatting (black)
run: black --check src/ tests/ || true
continue-on-error: true
- name: Type check (mypy)
run: mypy src/otto/ --ignore-missing-imports || true
continue-on-error: true
# ===========================================================================
# Security Scan
# ===========================================================================
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install security tools
run: pip install bandit safety
- name: Run Bandit (security linter)
run: bandit -r src/ -ll -ii -f json -o bandit-results.json || true
continue-on-error: true
- name: Upload Bandit results
uses: actions/upload-artifact@v4
with:
name: bandit-results
path: bandit-results.json
if: always()
- name: Check dependencies (safety)
run: safety check || true
continue-on-error: true
# ===========================================================================
# Build Docker Images
# ===========================================================================
docker:
name: Build Docker Images
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/otto-matrix-bot
tags: |
type=sha
type=raw,value=latest
- name: Build and push Matrix Bot
uses: docker/build-push-action@v5
with:
context: .
file: deploy/matrix-bot/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build Dashboard (no push)
uses: docker/build-push-action@v5
with:
context: deploy/dashboard
file: deploy/dashboard/Dockerfile
push: false
tags: ghcr.io/${{ github.repository }}/otto-dashboard:latest
continue-on-error: true
# ===========================================================================
# Release (on version tags)
# ===========================================================================
release:
name: Create Release
runs-on: ubuntu-latest
needs: [test]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}