Skip to content

Commit 7e86752

Browse files
committed
Merge branch 'release/1.1.3'
2 parents 5d99222 + 2c7ef34 commit 7e86752

15 files changed

+470
-525
lines changed

β€Ž.github/workflows/build-and-package.ymlβ€Ž

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,13 @@ jobs:
110110
echo "Testing auto-built action"
111111
112112
- name: Test the built action
113+
id: test-action
113114
uses: ./
114115
with:
115-
access_key: "test-key"
116-
secret_key: "test-secret"
116+
access_key: ${{ secrets.OBS_ACCESS_KEY }}
117+
secret_key: ${{ secrets.OBS_SECRET_KEY }}
117118
region: "cn-north-4"
118-
bucket: "test-bucket"
119+
bucket: ${{ secrets.OBS_BUCKET }}
119120
operation: upload
120121
local_path: build-test.txt
121122
obs_path: test/
@@ -124,5 +125,11 @@ jobs:
124125

125126
- name: Verify test completed
126127
run: |
127-
echo "βœ… Built action test completed"
128-
echo "🎯 Action is ready for use"
128+
if [ "${{ steps.test-action.outcome }}" = "success" ]; then
129+
echo "βœ… Built action test completed successfully"
130+
echo "🎯 Action is ready for use"
131+
else
132+
echo "❌ Built action test failed"
133+
echo "🚫 Action needs debugging"
134+
exit 1
135+
fi

β€Ž.github/workflows/test-upload.ymlβ€Ž

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- directory
1515
- wildcard-patterns
1616
- large-files
17+
- large-multipart-test
1718
bucket:
1819
description: 'OBS bucket name for testing'
1920
required: false
@@ -45,6 +46,31 @@ jobs:
4546
chmod +x generate-test-files.sh
4647
./generate-test-files.sh
4748
49+
- name: Create large test file (>1GB) for multipart upload testing
50+
if: inputs.test_scenario == 'large-files' || inputs.test_scenario == 'large-multipart-test'
51+
run: |
52+
echo "πŸ”₯ Creating large test file (>1GB) for multipart upload testing..."
53+
54+
# Create a 1.2GB test file using dd with /dev/zero for speed
55+
# This will trigger the multipart upload functionality
56+
dd if=/dev/zero of=test-files/large-multipart-test.bin bs=1M count=1200 status=progress
57+
58+
# Verify file size
59+
FILE_SIZE=$(stat -c%s test-files/large-multipart-test.bin)
60+
FILE_SIZE_MB=$((FILE_SIZE / 1024 / 1024))
61+
echo "βœ… Created large test file: ${FILE_SIZE_MB}MB (${FILE_SIZE} bytes)"
62+
63+
# This should be larger than 1GB threshold (1073741824 bytes)
64+
if [ $FILE_SIZE -gt 1073741824 ]; then
65+
echo "🎯 File size exceeds 1GB threshold - will trigger multipart upload"
66+
else
67+
echo "⚠️ File size is below 1GB threshold - multipart upload may not be triggered"
68+
fi
69+
70+
# List all test files for verification
71+
echo "πŸ“‚ All test files created:"
72+
ls -lh test-files/
73+
4874
- name: Test Single File Upload
4975
if: inputs.test_scenario == 'single-file'
5076
uses: ./
@@ -119,13 +145,61 @@ jobs:
119145
storage_class: STANDARD
120146
retry_count: 5
121147

148+
- name: Test Large Multipart Upload (>1GB)
149+
if: inputs.test_scenario == 'large-files' || inputs.test_scenario == 'large-multipart-test'
150+
uses: ./
151+
with:
152+
access_key: ${{ env.OBS_ACCESS_KEY }}
153+
secret_key: ${{ env.OBS_SECRET_KEY }}
154+
region: ${{ env.OBS_REGION }}
155+
bucket: ${{ env.OBS_BUCKET }}
156+
operation: upload
157+
local_path: test-files/large-multipart-test.bin
158+
obs_path: test-uploads/multipart/
159+
progress: true
160+
checksum_validation: false # Disable for large files to save time
161+
storage_class: STANDARD
162+
retry_count: 3
163+
timeout: 1800000 # 30 minutes timeout for large uploads
164+
122165
- name: Verify Upload Results
123166
run: |
167+
echo "## 🎯 Upload Test Results Summary"
124168
echo "Upload test completed for scenario: ${{ inputs.test_scenario }}"
169+
echo ""
170+
171+
if [ "${{ inputs.test_scenario }}" = "large-files" ] || [ "${{ inputs.test_scenario }}" = "large-multipart-test" ]; then
172+
echo "### πŸ“Š Large File Upload Test"
173+
echo "- βœ… 1.2GB test file created and uploaded"
174+
echo "- πŸ”§ Multipart upload should have been triggered automatically"
175+
echo "- πŸ“‚ Check logs above for multipart upload messages:"
176+
echo " - Look for: 'πŸ“¦ Large file detected (1200MB), using multipart upload'"
177+
echo " - Look for: 'πŸ“¦ Multipart upload initialized'"
178+
echo " - Look for: 'πŸ“¦ Part X uploaded'"
179+
echo " - Look for: 'βœ… Large file uploaded successfully'"
180+
echo ""
181+
echo "### πŸ” What to Verify in OBS:"
182+
echo "- File should be uploaded to: test-uploads/multipart/large-multipart-test.bin"
183+
echo "- File size should be exactly 1,258,291,200 bytes (1.2GB)"
184+
echo "- No 403 Forbidden errors should occur"
185+
fi
186+
125187
echo "Check the action outputs and OBS bucket for uploaded files"
126188
127189
- name: Cleanup Test Files
128190
if: always()
129191
run: |
192+
echo "🧹 Cleaning up test files..."
193+
194+
# Show space usage before cleanup
195+
echo "Disk usage before cleanup:"
196+
df -h
197+
198+
# Remove test files
130199
rm -rf test-files/
131-
echo "Test files cleaned up"
200+
201+
echo "βœ… Test files cleaned up"
202+
203+
# Show space usage after cleanup
204+
echo "Disk usage after cleanup:"
205+
df -h

0 commit comments

Comments
Β (0)