diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index 7281a30..0e5b42e 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -45,8 +45,11 @@ jobs: platforms: linux/amd64 - name: Start agent container + env: + SECRETS_JSON: ${{ toJson(secrets) }} run: | - docker run -d -p 9009:9009 --name agent-container $(echo "${{ steps.meta.outputs.tags }}" | head -n1) --host 0.0.0.0 --port 9009 + echo "$SECRETS_JSON" | jq -r 'to_entries[] | "\(.key)=\(.value)"' > .env + docker run -d -p 9009:9009 --name agent-container --env-file .env $(echo "${{ steps.meta.outputs.tags }}" | head -n1) --host 0.0.0.0 --port 9009 timeout 30 bash -c 'until curl -sf http://localhost:9009/.well-known/agent-card.json > /dev/null; do sleep 1; done' - name: Set up uv diff --git a/README.md b/README.md index 2751535..e47164d 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,13 @@ src/ ├─ executor.py # A2A request handling ├─ agent.py # Your agent implementation goes here └─ messenger.py # A2A messaging utilities +tests/ +└─ test_agent.py # Agent tests Dockerfile # Docker configuration pyproject.toml # Python dependencies -uv.lock # Locked dependencies +.github/ +└─ workflows/ + └─ test-and-publish.yml # CI workflow ``` ## Getting Started @@ -23,6 +27,8 @@ uv.lock # Locked dependencies 3. **Configure your agent card** - Fill in your agent's metadata (name, skills, description) in [`src/server.py`](src/server.py) +4. **Write your tests** - Add custom tests for your agent in [`tests/test_agent.py`](tests/test_agent.py) + ## Running Locally ```bash @@ -59,7 +65,9 @@ uv run pytest --agent-url http://localhost:9009 ## Publishing -The repository includes a GitHub Actions workflow that automatically builds, tests, and publishes a Docker image of your agent to GitHub Container Registry: +The repository includes a GitHub Actions workflow that automatically builds, tests, and publishes a Docker image of your agent to GitHub Container Registry. + +If your agent needs API keys or other secrets, add them in Settings → Secrets and variables → Actions → Repository secrets. They'll be available as environment variables during CI tests. - **Push to `main`** → publishes `latest` tag: ```