[CI] Fix log artifact not containing test logs attempt 2 (#150234)

Fixes #ISSUE_NUMBER
Take two of https://github.com/pytorch/pytorch/pull/149577 since it didn't work
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150234
Approved by: https://github.com/malfet, https://github.com/seemethere
This commit is contained in:
Catherine Lee
2025-04-01 17:13:58 +00:00
committed by PyTorch MergeBot
parent f94ac263af
commit a17ee8181a

View File

@ -48,14 +48,8 @@ runs:
run: |
# Remove any previous usage logs if they exist
rm -f logs-*.zip
# this workflow is also run in bazel build test, but we dont generate usage reports for it
# so check to see if the file exists first
if [ -f 'usage_log.txt' ]; then
zip "logs-${FILE_SUFFIX}.zip" 'usage_log.txt'
fi
if find "test/test-reports" -name "*.log" 2>/dev/null | stdbuf -o0 grep -q .; then
zip -r "logs-${FILE_SUFFIX}.zip" test/test-reports -i '*.log'
fi
zip "logs-${FILE_SUFFIX}.zip" 'usage_log.txt' || true
zip -r "logs-${FILE_SUFFIX}.zip" test/test-reports -i '*.log' || true
- name: Zip debugging artifacts for upload
if: runner.os != 'Windows' && !inputs.use-gha