File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
actions/upload_failure_logs_if_exists Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : ' upload failure-logs if exists'
2
+ description : ' upload failure-logs if exists'
3
+ runs :
4
+ using : " composite"
5
+ steps :
6
+ - name : " Check if failure-logs exists"
7
+ if : always()
8
+ id : check-if-failure-logs-exists
9
+ run : echo "exists=$([ -d "failure-logs" ] && echo "true" || echo "false")" >> "$GITHUB_OUTPUT"
10
+ - name : " Upload failure-logs"
11
+ if : steps.check-if-failure-logs-exists.outputs.exists == 'true'
12
+ uses : actions/upload-artifact@v4
13
+ with :
14
+ name : failure-logs
15
+ path : failure-logs/
Original file line number Diff line number Diff line change @@ -194,6 +194,8 @@ jobs:
194
194
# GHA macOS is slow and flaky, so we only test default.yaml here.
195
195
# Other yamls are tested on Linux instances.
196
196
#
197
+ - if : always()
198
+ uses : ./.github/actions/upload_failure_logs_if_exists
197
199
- name : " Show cache"
198
200
if : always()
199
201
run : ./hack/debug-cache.sh
@@ -258,6 +260,8 @@ jobs:
258
260
retry_on : error
259
261
max_attempts : 3
260
262
command : ./hack/test-templates.sh templates/${{ matrix.template }}
263
+ - if : always()
264
+ uses : ./.github/actions/upload_failure_logs_if_exists
261
265
- name : " Show cache"
262
266
run : ./hack/debug-cache.sh
263
267
@@ -357,6 +361,8 @@ jobs:
357
361
retry_on : error
358
362
max_attempts : 3
359
363
command : ./hack/test-templates.sh templates/vmnet.yaml
364
+ - if : always()
365
+ uses : ./.github/actions/upload_failure_logs_if_exists
360
366
361
367
upgrade :
362
368
name : " Upgrade test"
@@ -425,3 +431,5 @@ jobs:
425
431
env :
426
432
LIMACTL_CREATE_ARGS : " --vm-type vz --mount-type virtiofs --rosetta --network vzNAT"
427
433
run : ./hack/test-templates.sh templates/${{ matrix.template }}
434
+ - if : failure()
435
+ uses : ./.github/actions/upload_failure_logs_if_exists
Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ function diagnose() {
97
97
tail " $HOME /.lima/${NAME} " /* .log
98
98
limactl shell " $NAME " systemctl --no-pager status
99
99
limactl shell " $NAME " systemctl --no-pager
100
- limactl shell " $NAME " sudo cat /var/log/cloud-init-output.log
100
+ mkdir -p failure-logs
101
+ cp -pf " $HOME /.lima/${NAME} " /* .log failure-logs/
102
+ limactl shell " $NAME " sudo cat /var/log/cloud-init-output.log | tee failure-logs/cloud-init-output.log
101
103
set +x -e
102
104
}
103
105
You can’t perform that action at this time.
0 commit comments