Add ADK #4
Workflow file for this run
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: Test Obol Agent AG-UI | |
| on: | |
| push: | |
| branches: [ main, feature/* ] | |
| paths: | |
| - 'obol-adk/obol-agent-ag-ui/**' | |
| - '.github/workflows/test-obol-agent-ag-ui.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'obol-adk/obol-agent-ag-ui/**' | |
| - '.github/workflows/test-obol-agent-ag-ui.yml' | |
| jobs: | |
| test-agent-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build obol-agent-ag-ui image | |
| run: | | |
| docker build -f obol-adk/obol-agent-ag-ui/Dockerfile \ | |
| -t obol-agent-ag-ui:test \ | |
| obol-adk/obol-agent-ag-ui | |
| - name: Test agent image | |
| run: | | |
| # Test that the image was built successfully | |
| docker images | grep obol-agent-ag-ui | |
| # Test that required Python packages are installed | |
| docker run --rm obol-agent-ag-ui:test python -c "import google.adk, ag_ui_adk, fastapi, uvicorn; print('All packages imported successfully')" | |
| # Test that agent.py exists | |
| docker run --rm obol-agent-ag-ui:test ls -la /app/agent.py | |
| test-agent-endpoint: | |
| runs-on: ubuntu-latest | |
| needs: test-agent-build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| cd obol-adk/obol-agent-ag-ui | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install requests | |
| - name: Start agent in background | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| run: | | |
| cd obol-adk/obol-agent-ag-ui | |
| # Create minimal .env | |
| echo "FILESYSTEM_MCP_PATHS=" > .env | |
| echo "GOOGLE_API_KEY=${GOOGLE_API_KEY}" >> .env | |
| # Start agent in background | |
| nohup python agent.py > agent.log 2>&1 & | |
| echo $! > agent.pid | |
| # Wait for agent to start | |
| sleep 10 | |
| - name: Run health check | |
| run: | | |
| # Check if agent is responding | |
| curl -f http://localhost:8000/health || (cat obol-adk/obol-agent-ag-ui/agent.log && exit 1) | |
| - name: Run endpoint tests | |
| run: | | |
| cd obol-adk/obol-agent-ag-ui | |
| python test_agent.py || (cat agent.log && exit 1) | |
| - name: Stop agent | |
| if: always() | |
| run: | | |
| if [ -f obol-adk/obol-agent-ag-ui/agent.pid ]; then | |
| kill $(cat obol-adk/obol-agent-ag-ui/agent.pid) || true | |
| fi | |
| - name: Upload agent logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: agent-logs | |
| path: obol-adk/obol-agent-ag-ui/agent.log | |
| test-docker-agent-endpoint: | |
| runs-on: ubuntu-latest | |
| needs: test-agent-build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and run agent container | |
| env: | |
| GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
| run: | | |
| cd obol-adk/obol-agent-ag-ui | |
| docker build -t obol-agent-ag-ui:test . | |
| # Create minimal .env | |
| echo "FILESYSTEM_MCP_PATHS=" > .env | |
| echo "GOOGLE_API_KEY=${GOOGLE_API_KEY}" >> .env | |
| # Run container in detached mode | |
| docker run -d --name obol-agent \ | |
| -p 8000:8000 \ | |
| --env-file .env \ | |
| obol-agent-ag-ui:test | |
| # Wait for agent to start | |
| sleep 15 | |
| - name: Test Docker agent health | |
| run: | | |
| curl -f http://localhost:8000/health || (docker logs obol-agent && exit 1) | |
| - name: Test Docker agent endpoint | |
| run: | | |
| # Test simple query | |
| curl -s -X POST http://localhost:8000/ \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"threadId":"test","runId":"run-1","tools":[],"context":[],"forwardedProps":{"config":{},"threadMetadata":{}},"state":{},"messages":[{"id":"msg-1","role":"user","content":"List your available tools"}]}' \ | |
| | grep -q "obol" || (docker logs obol-agent && exit 1) | |
| - name: Stop and cleanup container | |
| if: always() | |
| run: | | |
| docker stop obol-agent || true | |
| docker rm obol-agent || true | |
| - name: Upload container logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-agent-logs | |
| path: /tmp/docker-logs.txt | |
| continue-on-error: true |