Skip to content

Commit 614e088

Browse files
committed
Fix pending Integration Tests check for non-agentex PRs
The "Integration Tests Summary" check is required by branch protection, but the workflow only triggered on changes to agentex/**. This caused PRs that only modify other files (like dependency updates) to have a perpetually pending check. Changes: - Remove paths filter from pull_request trigger so workflow always runs - Add "Detect Changes" job that checks if agentex/ files changed - Gate test jobs on the changes detection output - Summary job always runs to satisfy branch protection, but reports "skipped" when no agentex changes detected
1 parent a9f298c commit 614e088

1 file changed

Lines changed: 61 additions & 4 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ permissions:
66

77
on:
88
pull_request:
9-
paths:
10-
- "agentex/**"
9+
# No paths filter - workflow always triggers so required check is created
10+
# Actual test execution is gated by the 'changes' job below
1111
push:
1212
branches:
1313
- main
@@ -22,8 +22,52 @@ on:
2222
default: main
2323

2424
jobs:
25+
changes:
26+
name: "Detect Changes"
27+
runs-on: ubuntu-latest
28+
outputs:
29+
should-run: ${{ steps.check.outputs.should-run }}
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Check for agentex changes
36+
id: check
37+
run: |
38+
# Always run for workflow_dispatch
39+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
40+
echo "should-run=true" >> $GITHUB_OUTPUT
41+
echo "✅ Running: workflow_dispatch trigger"
42+
exit 0
43+
fi
44+
45+
# Always run for push events (they already have paths filter)
46+
if [[ "${{ github.event_name }}" == "push" ]]; then
47+
echo "should-run=true" >> $GITHUB_OUTPUT
48+
echo "✅ Running: push event (paths filter already applied)"
49+
exit 0
50+
fi
51+
52+
# For PRs, check if agentex/ files changed
53+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
54+
HEAD_SHA="${{ github.sha }}"
55+
56+
echo "Comparing $BASE_SHA..$HEAD_SHA"
57+
58+
if git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep -q '^agentex/'; then
59+
echo "should-run=true" >> $GITHUB_OUTPUT
60+
echo "✅ Running: agentex/ files changed"
61+
else
62+
echo "should-run=false" >> $GITHUB_OUTPUT
63+
echo "⏭️ Skipping: no agentex/ files changed"
64+
git diff --name-only "$BASE_SHA" "$HEAD_SHA" | head -20
65+
fi
66+
2567
discover-agent-images:
2668
name: "Discover Tutorial Agent Images"
69+
needs: changes
70+
if: needs.changes.outputs.should-run == 'true'
2771
runs-on: ubuntu-latest
2872
outputs:
2973
agent-matrix: ${{ steps.discover.outputs.agent-matrix }}
@@ -446,13 +490,25 @@ jobs:
446490
retention-days: 1
447491

448492
# Summary job to ensure the workflow fails if any test fails
493+
# This job ALWAYS runs to satisfy branch protection requirements
449494
integration-tests-summary:
450495
name: "Integration Tests Summary"
451496
runs-on: ubuntu-latest
452-
needs: [discover-agent-images, run-integration-tests]
453-
if: always() # Run even if some tests fail
497+
needs: [changes, discover-agent-images, run-integration-tests]
498+
if: always() # Always run to create the required status check
454499
steps:
500+
- name: Skip if no agentex changes
501+
if: needs.changes.outputs.should-run != 'true'
502+
run: |
503+
echo "# ⏭️ Integration Tests Skipped" >> $GITHUB_STEP_SUMMARY
504+
echo "" >> $GITHUB_STEP_SUMMARY
505+
echo "No changes detected in \`agentex/\` directory." >> $GITHUB_STEP_SUMMARY
506+
echo "" >> $GITHUB_STEP_SUMMARY
507+
echo "This PR only modifies files outside the agentex backend, so integration tests are not required." >> $GITHUB_STEP_SUMMARY
508+
echo "✅ Skipped - no agentex/ changes"
509+
455510
- name: Download all test results
511+
if: needs.changes.outputs.should-run == 'true'
456512
uses: actions/download-artifact@v4
457513
with:
458514
pattern: test-result-*
@@ -461,6 +517,7 @@ jobs:
461517
continue-on-error: true
462518

463519
- name: Generate Integration Test Summary
520+
if: needs.changes.outputs.should-run == 'true'
464521
run: |
465522
echo "# 🧪 AgentEx Integration Tests Summary" >> $GITHUB_STEP_SUMMARY
466523
echo "" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)