Skip to content

chore(deps): bump pydantic-settings from 2.1.0 to 2.14.1 in /app/ai-service #13

chore(deps): bump pydantic-settings from 2.1.0 to 2.14.1 in /app/ai-service

chore(deps): bump pydantic-settings from 2.1.0 to 2.14.1 in /app/ai-service #13

Workflow file for this run

name: AI Service CI
on:
push:
paths:
- 'app/ai-service/**'
- '.github/workflows/ai-service-ci.yml'
branches: [ main, develop ]
tags: [ 'v*' ]
pull_request:
paths:
- 'app/ai-service/**'
- '.github/workflows/ai-service-ci.yml'
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
working-directory: ./app/ai-service
run: |
python -m pip install --upgrade pip
pip install flake8 black mypy
pip install -r requirements.txt
- name: Lint with flake8
working-directory: ./app/ai-service
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Check formatting with black
working-directory: ./app/ai-service
run: |
black --check .
continue-on-error: true
- name: Type checking with mypy
working-directory: ./app/ai-service
run: |
mypy . --ignore-missing-imports
continue-on-error: true
test:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
working-directory: ./app/ai-service
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -r requirements.txt
- name: Run tests with pytest
working-directory: ./app/ai-service
run: |
pytest --cov=. --cov-report=xml || echo "No tests found or tests failed"
continue-on-error: true
- name: Run setup verification
working-directory: ./app/ai-service
run: |
python test_setup.py
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
file: ./app/ai-service/coverage.xml
flags: ai-service
continue-on-error: true
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
working-directory: ./app/ai-service
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Verify application can start
working-directory: ./app/ai-service
run: |
python -c "from main import app; print(f'✓ App loaded: {app.title}')"
- name: Create deployment package
run: |
mkdir -p deploy
cp -r app/ai-service/* deploy/
cd deploy
zip -r ../ai-service-deploy.zip .
- name: Upload deployment artifact
uses: actions/upload-artifact@v4
with:
name: ai-service-deploy
path: ai-service-deploy.zip
retention-days: 7
docker-build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build production image
uses: docker/build-push-action@v5
with:
context: ./app/ai-service
file: ./app/ai-service/Dockerfile.simple
push: false
load: true
tags: chainforge-ai-service:test
- name: Test Docker container
run: |
docker run -d --name test-container -p 8000:8000 chainforge-ai-service:test
# Wait for container to be ready with retry logic
for i in $(seq 1 30); do
if curl -sf http://localhost:8000/health > /dev/null 2>&1; then
echo "✓ Container is ready!"
curl -f http://localhost:8000/health
docker stop test-container
docker rm test-container
exit 0
fi
echo "Waiting for container to start... (attempt $i/30)"
sleep 2
done
echo "✗ Container failed to start within 60 seconds"
docker logs test-container
docker stop test-container 2>/dev/null || true
docker rm test-container 2>/dev/null || true
exit 1
security-scan:
runs-on: ubuntu-latest
needs: [build, docker-build]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install safety and bandit
run: |
python -m pip install --upgrade pip
pip install safety bandit
- name: Check dependencies for vulnerabilities
working-directory: ./app/ai-service
run: |
safety check -r requirements.txt || true
- name: Security lint with bandit
working-directory: ./app/ai-service
run: |
bandit -r . -ll || true
docker-publish:
runs-on: ubuntu-latest
needs: security-scan
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/chainforge-ai-service
tags: |
type=ref,event=branch
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=sha-
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=staging,enable=${{ github.ref == 'refs/heads/main' }}
- name: Build and push production image
uses: docker/build-push-action@v5
with:
context: ./app/ai-service
file: ./app/ai-service/Dockerfile.simple
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
build-args: |
SOURCE_DATE_EPOCH=0