shows affected test summary

This commit is contained in:
Noah Campbell
2025-10-13 10:00:49 -05:00
parent d325804359
commit 1c234e432c
2 changed files with 29 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ permissions:
jobs:
test-affected:
# Only run if the build workflow succeeded and it's not a draft PR
# Only run if the build-test workflow succeeded and it's not a draft PR
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request' &&
@@ -99,6 +99,24 @@ jobs:
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish affected summary
if: always()
run: |
{
echo "### Affected unit packages";
if [ -s /tmp/affected.txt ]; then
sed 's/^/- /' /tmp/affected.txt;
else
echo "- (none)";
fi;
echo "\n### Affected e2e tests";
if [ -s /tmp/affected-e2e.txt ]; then
sed 's/^/- /' /tmp/affected-e2e.txt;
else
echo "- (none)";
fi;
} >> "$GITHUB_STEP_SUMMARY"
# 3) Run filtered tests only
- name: Run unit tests for affected packages
if: steps.affected.outputs.has_changes == 'true'

View File

@@ -37,8 +37,8 @@ jobs:
- run: make tidy-diff
test-integration:
if: github.event_name == 'push'
runs-on: ubuntu-latest
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
@@ -66,8 +66,8 @@ jobs:
path: bin/preflight
validate-preflight-e2e:
if: github.event_name == 'push'
runs-on: ubuntu-latest
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: compile-preflight
steps:
- uses: actions/checkout@v5
@@ -97,8 +97,8 @@ jobs:
path: bin/support-bundle
validate-supportbundle-e2e:
if: github.event_name == 'push'
runs-on: ubuntu-latest
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
- uses: actions/checkout@v5
@@ -116,10 +116,10 @@ jobs:
# Additional e2e tests for support bundle that run in Go, these create a Kind cluster
validate-supportbundle-e2e-go:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: compile-supportbundle
steps:
- uses: actions/checkout@v5
- name: Download support bundle binary
uses: actions/download-artifact@v5