Skip to content

Commit 1c234e4

Browse files
committed
shows affected test summary
1 parent d325804 commit 1c234e4

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

.github/workflows/affected-tests.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
test-affected:
14-
# Only run if the build workflow succeeded and it's not a draft PR
14+
# Only run if the build-test workflow succeeded and it's not a draft PR
1515
if: |
1616
github.event.workflow_run.conclusion == 'success' &&
1717
github.event.workflow_run.event == 'pull_request' &&
@@ -99,6 +99,24 @@ jobs:
9999
echo "has_changes=false" >> "$GITHUB_OUTPUT"
100100
fi
101101
102+
- name: Publish affected summary
103+
if: always()
104+
run: |
105+
{
106+
echo "### Affected unit packages";
107+
if [ -s /tmp/affected.txt ]; then
108+
sed 's/^/- /' /tmp/affected.txt;
109+
else
110+
echo "- (none)";
111+
fi;
112+
echo "\n### Affected e2e tests";
113+
if [ -s /tmp/affected-e2e.txt ]; then
114+
sed 's/^/- /' /tmp/affected-e2e.txt;
115+
else
116+
echo "- (none)";
117+
fi;
118+
} >> "$GITHUB_STEP_SUMMARY"
119+
102120
# 3) Run filtered tests only
103121
- name: Run unit tests for affected packages
104122
if: steps.affected.outputs.has_changes == 'true'

.github/workflows/build-test-deploy.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
- run: make tidy-diff
3838

3939
test-integration:
40-
if: github.event_name == 'push'
41-
runs-on: ubuntu-latest
40+
if: github.event_name == 'push'
41+
runs-on: ubuntu-latest
4242
steps:
4343
- uses: actions/checkout@v5
4444
- uses: actions/setup-go@v6
@@ -66,8 +66,8 @@ jobs:
6666
path: bin/preflight
6767

6868
validate-preflight-e2e:
69-
if: github.event_name == 'push'
70-
runs-on: ubuntu-latest
69+
if: github.event_name == 'push'
70+
runs-on: ubuntu-latest
7171
needs: compile-preflight
7272
steps:
7373
- uses: actions/checkout@v5
@@ -97,8 +97,8 @@ jobs:
9797
path: bin/support-bundle
9898

9999
validate-supportbundle-e2e:
100-
if: github.event_name == 'push'
101-
runs-on: ubuntu-latest
100+
if: github.event_name == 'push'
101+
runs-on: ubuntu-latest
102102
needs: compile-supportbundle
103103
steps:
104104
- uses: actions/checkout@v5
@@ -116,10 +116,10 @@ jobs:
116116

117117
# Additional e2e tests for support bundle that run in Go, these create a Kind cluster
118118
validate-supportbundle-e2e-go:
119-
if: github.event_name == 'push'
120-
runs-on: ubuntu-latest
121-
needs: compile-supportbundle
122-
steps:
119+
if: github.event_name == 'push'
120+
runs-on: ubuntu-latest
121+
needs: compile-supportbundle
122+
steps:
123123
- uses: actions/checkout@v5
124124
- name: Download support bundle binary
125125
uses: actions/download-artifact@v5

0 commit comments

Comments
 (0)