Skip to content

ci: add workflows verifying compatibility with tools, docs, and agent… #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/verify-agent-builder-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Verify Agent Builder Compatibility

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test-dependency:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout sdk-python
uses: actions/checkout@v4
with:
path: sdk-python
- name: Checkout Agent Builder Repository
uses: actions/checkout@v4
with:
repository: strands-agents/agent-builder
path: agent-builder
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --no-cache-dir hatch
- name: Patch agent-builder dependency on tools and test
run: |
cd agent-builder

sed -i "s|.*strands-agents\[ollama\].*|\"strands-agents[ollama] @ file://${GITHUB_WORKSPACE}/sdk-python\",|" pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of updating the pyproject.toml, should we just add another target for pulling a local install?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like the following in the tools repo

[tool.hatch.envs.test]
dependencies = [
"strands-agents[ollama] @ file://${GITHUB_WORKSPACE}/sdk-python",
]

I thought about this but it leaves the workflow specific test logic in the pyproject which seemed odd to me. I can update if you think thats better than hiding the oddness in the workflow

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to see if I can do this with an env var actually

count=$(grep -c "strands-agents\[ollama\] @ file://${GITHUB_WORKSPACE}/sdk-python" pyproject.toml)

if [ "$count" -eq 2 ]; then
echo "Dependency found exactly twice in pyproject.toml"
else
echo "Dependency found $count times, expected 2"
exit 1
fi

hatch run test
42 changes: 42 additions & 0 deletions .github/workflows/verify-docs-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Verify Docs Compatibility

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test-dependency:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout sdk-python
uses: actions/checkout@v4
with:
path: sdk-python
- name: Checkout Tools Repository
uses: actions/checkout@v4
with:
repository: strands-agents/docs
path: docs
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Patch tools dependency sdk-python and test
run: |
cd docs
sed -i "s|.*strands-agents.*|strands-agents @ file://${GITHUB_WORKSPACE}/sdk-python|" requirements.txt
count=$(grep -c "strands-agents @ file://${GITHUB_WORKSPACE}/sdk-python" requirements.txt)
if [ "$count" -eq 1 ]; then
echo "Dependency found exactly once in requirements.txt"
else
echo "Dependency found $count times, expected 1"
exit 1
fi
pip install -r requirements.txt
mkdocs build --strict
51 changes: 51 additions & 0 deletions .github/workflows/verify-tools-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Verify Tools Compatibility

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test-dependency:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout sdk-python
uses: actions/checkout@v4
with:
path: sdk-python
- name: Checkout Tools Repository
uses: actions/checkout@v4
with:
repository: strands-agents/tools
path: tools
- name: Checkout Agent Builder Repository
uses: actions/checkout@v4
with:
repository: strands-agents/agent-builder
path: agent-builder
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --no-cache-dir hatch
- name: Patch tools dependency on sdk-python and test
run: |
cd tools
sed -i "s|.*strands-agents>.*|\"strands-agents @ file://${GITHUB_WORKSPACE}/sdk-python/\",|" pyproject.toml

count=$(grep -c "strands-agents @ file://${GITHUB_WORKSPACE}/sdk-python" pyproject.toml)
if [ "$count" -eq 2 ]; then
echo "Dependency found exactly twice in pyproject.toml"
else
echo "Dependency found $count times, expected 2"
exit 1
fi

hatch run test
Loading