Skip to content

Commit d09f0fd

Browse files
bbrksclaude
andauthored
CI: upload rendered test logs as artifacts on failure (#8246)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cb95e1d commit d09f0fd

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ jobs:
112112
uses: *go_test_annotations_version
113113
with:
114114
test-results: test.json
115+
- name: Render test log
116+
if: failure()
117+
shell: bash
118+
run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true
119+
- name: Upload test logs artifact
120+
if: failure()
121+
uses: actions/upload-artifact@v4
122+
with:
123+
name: test-logs-${{ github.job }}-${{ matrix.name || matrix.os || 'default' }}
124+
path: test.log
125+
retention-days: 7
126+
if-no-files-found: warn
115127

116128
test-race:
117129
runs-on: ubuntu-latest
@@ -136,6 +148,18 @@ jobs:
136148
uses: *go_test_annotations_version
137149
with:
138150
test-results: test.json
151+
- name: Render test log
152+
if: failure()
153+
shell: bash
154+
run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true
155+
- name: Upload test logs artifact
156+
if: failure()
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: test-logs-${{ github.job }}
160+
path: test.log
161+
retention-days: 7
162+
if-no-files-found: warn
139163

140164
test-default-collection:
141165
runs-on: ubuntu-latest
@@ -161,6 +185,18 @@ jobs:
161185
uses: *go_test_annotations_version
162186
with:
163187
test-results: test.json
188+
- name: Render test log
189+
if: failure()
190+
shell: bash
191+
run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true
192+
- name: Upload test logs artifact
193+
if: failure()
194+
uses: actions/upload-artifact@v4
195+
with:
196+
name: test-logs-${{ github.job }}
197+
path: test.log
198+
retention-days: 7
199+
if-no-files-found: warn
164200
test-benchmark-compile:
165201
runs-on: ubuntu-latest
166202
env:
@@ -184,6 +220,18 @@ jobs:
184220
uses: *go_test_annotations_version
185221
with:
186222
test-results: test.json
223+
- name: Render test log
224+
if: failure()
225+
shell: bash
226+
run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true
227+
- name: Upload test logs artifact
228+
if: failure()
229+
uses: actions/upload-artifact@v4
230+
with:
231+
name: test-logs-${{ github.job }}
232+
path: test.log
233+
retention-days: 7
234+
if-no-files-found: warn
187235

188236

189237
test-disable-rev-cache:
@@ -210,6 +258,18 @@ jobs:
210258
uses: *go_test_annotations_version
211259
with:
212260
test-results: test.json
261+
- name: Render test log
262+
if: failure()
263+
shell: bash
264+
run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true
265+
- name: Upload test logs artifact
266+
if: failure()
267+
uses: actions/upload-artifact@v4
268+
with:
269+
name: test-logs-${{ github.job }}
270+
path: test.log
271+
retention-days: 7
272+
if-no-files-found: warn
213273

214274
python-format:
215275
runs-on: ubuntu-latest
@@ -266,6 +326,18 @@ jobs:
266326
uses: *go_test_annotations_version
267327
with:
268328
test-results: test.json
329+
- name: Render test log
330+
if: failure()
331+
shell: bash
332+
run: gotestsum --format standard-verbose --raw-command -- cat test.json > test.log 2>&1 || true
333+
- name: Upload test logs artifact
334+
if: failure()
335+
uses: actions/upload-artifact@v4
336+
with:
337+
name: test-logs-${{ github.job }}-${{ matrix.name || matrix.os || 'default' }}
338+
path: test.log
339+
retention-days: 7
340+
if-no-files-found: warn
269341
cache_perf_tool_build:
270342
runs-on: ubuntu-latest
271343
name: build cache perf tool

0 commit comments

Comments
 (0)