chore: update memex submodule to remove nested submodules #8
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: Docker Dev Test | |
| on: | |
| pull_request: | |
| branches: [dev, main] | |
| push: | |
| branches: [dev] | |
| workflow_dispatch: | |
| jobs: | |
| test-dev: | |
| name: Test Docker Dev Environment | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create .env file | |
| run: | | |
| cp .env.development.example .env | |
| echo "Created .env from development example" | |
| - name: Validate docker-compose configurations | |
| run: | | |
| echo "Validating base configuration..." | |
| cd infra | |
| docker-compose -f docker-compose.yml config > /dev/null | |
| echo "Validating dev configuration..." | |
| docker-compose -f docker-compose.yml -f docker-compose.dev.yml config > /dev/null | |
| echo "✓ All configurations valid" | |
| - name: Build Docker images | |
| run: | | |
| cd infra | |
| docker-compose -f docker-compose.yml -f docker-compose.dev.yml build --no-cache | |
| - name: Start services | |
| run: | | |
| cd infra | |
| docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d mongo redis qdrant api | |
| echo "Services started" | |
| - name: Wait for services to be healthy | |
| run: | | |
| echo "Waiting for services to be healthy..." | |
| timeout 120 bash -c ' | |
| while true; do | |
| if docker ps --filter "name=sbd-mongo" --filter "health=healthy" | grep -q sbd-mongo && \ | |
| docker ps --filter "name=sbd-redis" --filter "health=healthy" | grep -q sbd-redis && \ | |
| docker ps --filter "name=sbd-qdrant" --filter "health=healthy" | grep -q sbd-qdrant && \ | |
| docker ps --filter "name=sbd-api" --filter "health=healthy" | grep -q sbd-api; then | |
| echo "All services are healthy!" | |
| break | |
| fi | |
| echo "Waiting for services..." | |
| sleep 5 | |
| done | |
| ' | |
| - name: Show service status | |
| run: | | |
| cd infra | |
| docker-compose ps | |
| - name: Test API health endpoint | |
| run: | | |
| echo "Testing API health endpoint..." | |
| curl -f http://localhost:8000/health || exit 1 | |
| echo "✓ API is responding" | |
| - name: Test API docs endpoint | |
| run: | | |
| echo "Testing API docs endpoint..." | |
| curl -f http://localhost:8000/docs || exit 1 | |
| echo "✓ API docs are accessible" | |
| - name: Run basic connectivity tests | |
| run: | | |
| echo "Testing MongoDB connectivity..." | |
| docker exec sbd-mongo mongosh --eval "db.runCommand({ ping: 1 })" --quiet | |
| echo "Testing Redis connectivity..." | |
| docker exec sbd-redis redis-cli ping | |
| echo "✓ All services are accessible" | |
| - name: Show logs on failure | |
| if: failure() | |
| run: | | |
| cd infra | |
| echo "=== API Logs ===" | |
| docker-compose logs --tail=100 api | |
| echo "=== MongoDB Logs ===" | |
| docker-compose logs --tail=50 mongo | |
| echo "=== Redis Logs ===" | |
| docker-compose logs --tail=50 redis | |
| echo "=== Qdrant Logs ===" | |
| docker-compose logs --tail=50 qdrant | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| cd infra | |
| docker-compose -f docker-compose.yml -f docker-compose.dev.yml down -v --remove-orphans | |
| docker system prune -f |