fix
This commit is contained in:
@@ -40,85 +40,12 @@ jobs:
|
|||||||
echo "File sizes:"
|
echo "File sizes:"
|
||||||
find ./TestResults -name "*.trx" -exec ls -lh {} \;
|
find ./TestResults -name "*.trx" -exec ls -lh {} \;
|
||||||
|
|
||||||
- name: Compress test results
|
- name: Upload test results
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ -d "./TestResults" ] && [ "$(ls -A ./TestResults)" ]; then
|
|
||||||
echo "Compressing test results to reduce upload size..."
|
|
||||||
echo "Original file sizes:"
|
|
||||||
find ./TestResults -type f -exec ls -lh {} \;
|
|
||||||
echo "Total directory size:"
|
|
||||||
du -sh ./TestResults
|
|
||||||
|
|
||||||
# Create compressed archive
|
|
||||||
tar -czf test-results-compressed.tar.gz -C ./TestResults .
|
|
||||||
echo "Compressed file size:"
|
|
||||||
ls -lh test-results-compressed.tar.gz
|
|
||||||
|
|
||||||
# Create a minimal summary file
|
|
||||||
echo "Test Results Summary" > test-summary.txt
|
|
||||||
echo "===================" >> test-summary.txt
|
|
||||||
echo "Generated: $(date)" >> test-summary.txt
|
|
||||||
echo "Files:" >> test-summary.txt
|
|
||||||
find ./TestResults -type f -exec basename {} \; >> test-summary.txt
|
|
||||||
echo "Summary file created:"
|
|
||||||
ls -lh test-summary.txt
|
|
||||||
else
|
|
||||||
echo "No test results found to compress"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload compressed test results (attempt 1)
|
|
||||||
id: upload1
|
|
||||||
if: always()
|
if: always()
|
||||||
uses: christopherhx/gitea-upload-artifact@v4
|
uses: christopherhx/gitea-upload-artifact@v4
|
||||||
continue-on-error: true
|
|
||||||
with:
|
with:
|
||||||
name: test-results-compressed
|
name: test-results
|
||||||
path: |
|
|
||||||
./test-results-compressed.tar.gz
|
|
||||||
./test-summary.txt
|
|
||||||
retention-days: 30
|
|
||||||
if-no-files-found: warn
|
|
||||||
|
|
||||||
- name: Upload original test results (attempt 2)
|
|
||||||
id: upload2
|
|
||||||
if: always() && failure()
|
|
||||||
uses: christopherhx/gitea-upload-artifact@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
name: test-results-original
|
|
||||||
path: ./TestResults/
|
path: ./TestResults/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
|
|
||||||
- name: Upload summary only (attempt 3)
|
|
||||||
id: upload3
|
|
||||||
if: always() && failure()
|
|
||||||
uses: christopherhx/gitea-upload-artifact@v4
|
|
||||||
continue-on-error: true
|
|
||||||
with:
|
|
||||||
name: test-results-summary
|
|
||||||
path: ./test-summary.txt
|
|
||||||
retention-days: 30
|
|
||||||
if-no-files-found: warn
|
|
||||||
|
|
||||||
- name: Check upload status
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
if [ "${{ steps.upload1.outcome }}" == "success" ]; then
|
|
||||||
echo "✅ Compressed test results uploaded successfully"
|
|
||||||
elif [ "${{ steps.upload2.outcome }}" == "success" ]; then
|
|
||||||
echo "✅ Original test results uploaded successfully"
|
|
||||||
elif [ "${{ steps.upload3.outcome }}" == "success" ]; then
|
|
||||||
echo "✅ Test summary uploaded successfully (full results failed)"
|
|
||||||
else
|
|
||||||
echo "❌ Failed to upload test results after 3 attempts"
|
|
||||||
echo "This may be due to persistent network issues or Gitea server problems"
|
|
||||||
echo "Consider checking:"
|
|
||||||
echo " - Gitea server status"
|
|
||||||
echo " - Network connectivity"
|
|
||||||
echo " - Artifact storage configuration"
|
|
||||||
# Don't fail the workflow - tests passed, just upload failed
|
|
||||||
echo "⚠️ Workflow will continue despite upload failure"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user