Skip to content

Commit

Permalink
Add some badges 🚀 (#114)
Browse files Browse the repository at this point in the history
* Add code coverage checks

* Add badges, clean up test.yml workflow

* Moar badges!
  • Loading branch information
JoshuaC215 authored Dec 3, 2024
1 parent 386b790 commit 3fef912
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 108 deletions.
101 changes: 0 additions & 101 deletions .github/workflows/test-docker.yml

This file was deleted.

101 changes: 97 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python lint and test
name: Build and test

on:
push:
Expand All @@ -11,8 +11,7 @@ permissions:
contents: read

jobs:
test:

test-python:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -42,4 +41,98 @@ jobs:
- name: Test with pytest
run: |
uv run pytest
uv run pytest --cov=src/ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

test-docker:
runs-on: ubuntu-latest

services:
dind:
image: docker:dind
ports:
- 2375:2375
options: >-
--privileged
--health-cmd "docker info"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host

- name: Build service image
uses: docker/build-push-action@v3
with:
context: .
push: false
load: true
tags: agent-service-toolkit.service:${{ github.sha }}
file: docker/Dockerfile.service

- name: Build app image
uses: docker/build-push-action@v3
with:
context: .
push: false
load: true
tags: agent-service-toolkit.app:${{ github.sha }}
file: docker/Dockerfile.app

- name: Start service container
run: docker run -d --name service-container --network host -e USE_FAKE_MODEL=true agent-service-toolkit.service:${{ github.sha }}

- name: Confirm service starts correctly
run: |
timeout 30 bash -c '
while ! curl -s http://localhost/health; do
echo "Waiting for service to be ready..."
docker logs service-container
sleep 2
done
'
- name: Run app container
run: docker run -d --name app-container --network host -e AGENT_URL=http://localhost agent-service-toolkit.app:${{ github.sha }}

- name: Confirm app starts correctly
run: |
timeout 30 bash -c '
while ! curl -s http://localhost:8501/healthz; do
echo "Waiting for app to be ready..."
docker logs app-container
sleep 2
done
'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.5"
- name: Install ONLY CLIENT dependencies with uv
run: |
uv sync --frozen --only-group client --only-group dev
env:
UV_SYSTEM_PYTHON: 1
- name: Run integration tests
run: uv run pytest tests/integration -v --run-docker

- name: Clean up containers
if: always()
run: |
docker stop service-container app-container || true
docker rm service-container app-container || true
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 🧰 AI Agent Service Toolkit

[![build status](https://github.com/JoshuaC215/agent-service-toolkit/actions/workflows/test.yml/badge.svg)](https://github.com/JoshuaC215/agent-service-toolkit/actions/workflows/test.yml) [![codecov](https://codecov.io/github/JoshuaC215/agent-service-toolkit/graph/badge.svg?token=5MTJSYWD05)](https://codecov.io/github/JoshuaC215/agent-service-toolkit) ![Python Version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FJoshuaC215%2Fagent-service-toolkit%2Frefs%2Fheads%2Fbadges%2Fpyproject.toml)
![GitHub License](https://img.shields.io/github/license/JoshuaC215/agent-service-toolkit) [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_red.svg)](https://agent-service-toolkit.streamlit.app/)


This repository provides a blueprint and full toolkit for a LangGraph-based agent service architecture. It includes a [LangGraph](https://langchain-ai.github.io/langgraph/) agent, a [FastAPI](https://fastapi.tiangolo.com/) service to serve it, a client to interact with the service, and a [Streamlit](https://streamlit.io/) app that uses the client to provide a chat interface.

This project offers a template for you to easily build and run your own agents using the LangGraph framework. It demonstrates a complete setup from agent definition to user interface, making it easier to get started with LangGraph-based projects by providing a full, robust toolkit.
Expand All @@ -10,8 +14,6 @@ This project offers a template for you to easily build and run your own agents u

### [Try the app!](https://agent-service-toolkit.streamlit.app/)

[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://agent-service-toolkit.streamlit.app/)

<a href="https://agent-service-toolkit.streamlit.app/"><img src="media/app_screenshot.png" width="600"></a>

### Quickstart
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classifiers = [
"Programming Language :: Python :: 3.13",
]

requires-python = ">=3.11"
requires-python = ">=3.11, <3.13"

dependencies = [
"duckduckgo-search>=6.3.6",
Expand Down Expand Up @@ -45,6 +45,7 @@ dependencies = [
dev = [
"pre-commit",
"pytest",
"pytest-cov",
"pytest-env",
"pytest-asyncio",
"ruff",
Expand Down
Loading

0 comments on commit 3fef912

Please sign in to comment.