Skip to content
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
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,65 @@ on: # rebuild any PRs and main branch changes
- "releases/*"

jobs:
detect-standalone-changes:
name: Detect standalone sample changes
runs-on: ubuntu-latest
outputs:
projects: ${{ steps.changes.outputs.projects }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Build standalone project matrix
id: changes
shell: bash
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
if [[ -n "$BASE_SHA" ]] && git cat-file -e "$BASE_SHA^{commit}"; then
changed_files="$(git diff --name-only "$BASE_SHA" "$GITHUB_SHA")"
else
changed_files="$(git ls-files)"
fi

projects_json="$({
for project in \
bedrock_agentcore/strands_agent \
lambda_worker \
openai_agents/mcp_v2
do
if grep -q "^${project}/" <<< "$changed_files"; then
printf '%s\n' "$project"
fi
done
} | jq -Rsc 'split("\n") | map(select(length > 0))')"

echo "projects=$projects_json" >> "$GITHUB_OUTPUT"

standalone-lint-test:
name: Standalone (${{ matrix.project }}, Python ${{ matrix.python }})
needs: detect-standalone-changes
if: needs.detect-standalone-changes.outputs.projects != '[]'
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.14"]
project: ${{ fromJSON(needs.detect-standalone-changes.outputs.projects) }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python }}
- run: uv sync --locked --all-groups
working-directory: ${{ matrix.project }}
- run: uv run poe lint
working-directory: ${{ matrix.project }}
- run: uv run poe test
working-directory: ${{ matrix.project }}

# Build and test the project
build-lint-test:
strategy:
Expand Down
7 changes: 6 additions & 1 deletion bedrock_agentcore/strands_agent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ dev = [
"ruff>=0.5.0,<0.6",
"mypy>=1.4.1,<2",
"poethepoet>=0.36.0",
"pytest>=7.1.2,<8",
"pytest-asyncio>=0.18.3,<0.19",
]

[build-system]
Expand All @@ -41,6 +43,10 @@ lint = [
{ ref = "lint-types" },
]
lint-types = "uv run --all-groups mypy --check-untyped-defs --namespace-packages ."
test = "uv run pytest"

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.ruff]
target-version = "py310"
Expand All @@ -51,4 +57,3 @@ extend-exclude = ["agentcore"]
[tool.mypy]
ignore_missing_imports = true
exclude = ["agentcore/"]

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import asyncio

from agentcore_worker import ActivityTracker


async def test_activity_tracker_returns_after_idle_debounce() -> None:
tracker = ActivityTracker()

await asyncio.wait_for(tracker.wait_until_idle(0.001), timeout=1)
61 changes: 61 additions & 0 deletions bedrock_agentcore/strands_agent/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lambda_worker/lambda_function.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from activities import hello_activity
from temporalio.common import WorkerDeploymentVersion
from temporalio.contrib.aws.lambda_worker import LambdaWorkerConfig, run_worker
from temporalio.contrib.aws.lambda_worker.otel import apply_defaults

from activities import hello_activity
from workflows import TASK_QUEUE, SampleWorkflow


Expand Down
6 changes: 6 additions & 0 deletions lambda_worker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ dev = [
"ruff>=0.5.0,<0.6",
"mypy>=1.4.1,<2",
"poethepoet>=0.36.0",
"pytest>=7.1.2,<8",
"pytest-asyncio>=0.18.3,<0.19",
]

[build-system]
Expand All @@ -36,6 +38,10 @@ lint = [
{ ref = "lint-types" },
]
lint-types = "uv run --all-groups mypy --check-untyped-defs --namespace-packages ."
test = "uv run pytest"

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.ruff]
target-version = "py310"
9 changes: 9 additions & 0 deletions lambda_worker/tests/test_activities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from temporalio.testing import ActivityEnvironment

from activities import hello_activity


async def test_hello_activity() -> None:
result = await ActivityEnvironment().run(hello_activity, "Temporal")

assert result == "Hello, Temporal!"
84 changes: 83 additions & 1 deletion lambda_worker/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading