Skip to content
Merged
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
52 changes: 14 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

permissions:
contents: read
pull-requests: write

jobs:
quality:
Expand Down Expand Up @@ -138,48 +137,25 @@ jobs:
- run: mix compile

- name: Run TCK (all categories)
id: tck-run
run: bin/tck all 2>&1 | tee tck-output.txt

- name: Post TCK results to PR
- name: Save PR metadata for comment workflow
if: always() && github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ ! -f tck-output.txt ]; then
echo "No TCK output to post"
exit 0
fi

SUMMARY=$(sed -n '/COMPREHENSIVE TEST RESULTS SUMMARY/,/^={10,}/p' tck-output.txt | head -30)

if [ -z "$SUMMARY" ]; then
echo "No summary section found in TCK output"
exit 0
fi

MARKER="<!-- tck-compliance-results -->"
PR_NUMBER=${{ github.event.pull_request.number }}

{
echo "${MARKER}"
echo "## TCK Compliance Results"
echo ""
echo '```'
echo "$SUMMARY"
echo '```'
} > tck-comment.md
echo "${{ github.event.pull_request.number }}" > pr-number.txt
echo "${{ steps.tck-run.outcome }}" > tck-outcome.txt

BODY=$(cat tck-comment.md)

COMMENT_ID=$(gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" \
--jq "[.[] | select(.body | contains(\"${MARKER}\")) | .id] | first" 2>/dev/null || true)

if [ -n "$COMMENT_ID" ] && [ "$COMMENT_ID" != "null" ]; then
gh api "repos/${{ github.repository }}/issues/comments/${COMMENT_ID}" \
-X PATCH -f body="$BODY"
else
gh pr comment "$PR_NUMBER" --body-file tck-comment.md
fi
- name: Upload TCK results for PR comment
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: tck-results
path: |
tck-output.txt
pr-number.txt
tck-outcome.txt
retention-days: 1

publish:
name: Publish to Hex
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/tck-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: TCK PR Comment

on:
workflow_run:
workflows: ["CI"]
types: [completed]

permissions:
pull-requests: write

jobs:
comment:
name: Post TCK results to PR
runs-on: ubuntu-24.04
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion != 'cancelled'
steps:
- name: Download TCK results artifact
uses: actions/download-artifact@v4
with:
name: tck-results
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
continue-on-error: true
id: download

- name: Post TCK results comment
if: steps.download.outcome == 'success'
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
if [ ! -f tck-output.txt ]; then
echo "No TCK output file found"
exit 0
fi

if [ ! -f pr-number.txt ]; then
echo "No PR number file found"
exit 0
fi

PR_NUMBER=$(cat pr-number.txt)
if [ -z "$PR_NUMBER" ]; then
echo "PR number is empty"
exit 0
fi

SUMMARY=$(sed -n '/COMPREHENSIVE TEST RESULTS SUMMARY/,/^={10,}/p' tck-output.txt | head -30)

if [ -z "$SUMMARY" ]; then
echo "No summary section found in TCK output"
exit 0
fi

MARKER="<!-- tck-compliance-results -->"

{
echo "${MARKER}"
echo "## TCK Compliance Results"
echo ""
echo '```'
echo "$SUMMARY"
echo '```'
} > tck-comment.md

BODY=$(cat tck-comment.md)

COMMENT_ID=$(gh api "repos/${GH_REPO}/issues/${PR_NUMBER}/comments" \
--jq "[.[] | select(.body | contains(\"${MARKER}\")) | .id] | first" 2>/dev/null || true)

if [ -n "$COMMENT_ID" ] && [ "$COMMENT_ID" != "null" ]; then
gh api "repos/${GH_REPO}/issues/comments/${COMMENT_ID}" \
-X PATCH -f body="$BODY"
echo "Updated existing comment ${COMMENT_ID}"
else
gh pr comment "$PR_NUMBER" --body-file tck-comment.md
echo "Created new comment"
fi
2 changes: 1 addition & 1 deletion test/a2a/plug/auth_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ defmodule A2A.Plug.AuthTest do

describe "integration with A2A.Plug" do
test "auth identity flows to task metadata" do
agent = start_supervised!(A2A.Test.EchoAgent)
agent = start_supervised!({A2A.Test.EchoAgent, [name: nil]})

auth_opts =
Auth.init(
Expand Down
2 changes: 1 addition & 1 deletion test/a2a/plug/sse_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule A2A.Plug.SSETest do
end

setup do
agent = start_supervised!(A2A.Test.StreamAgent)
agent = start_supervised!({A2A.Test.StreamAgent, [name: nil]})
{:ok, agent: agent}
end

Expand Down
2 changes: 1 addition & 1 deletion test/a2a/plug_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule A2A.PlugTest do
end

setup do
agent = start_supervised!(A2A.Test.EchoAgent)
agent = start_supervised!({A2A.Test.EchoAgent, [name: nil]})
{:ok, agent: agent}
end

Expand Down
Loading