|
12 | 12 | - 'multiple-files' |
13 | 13 | - 'directory-upload' |
14 | 14 | - 'advanced-options' |
| 15 | + - 'large-file-test' |
15 | 16 | - 'dry-run' |
16 | 17 | default: 'dry-run' |
17 | 18 | region: |
|
56 | 57 | echo "Configuration file content" > test-files/config/app.json |
57 | 58 | echo "Binary-like content" > test-files/images/logo.png |
58 | 59 |
|
59 | | - # Create a larger file for testing |
| 60 | + # Create a larger file for testing (1KB) |
60 | 61 | head -c 1024 /dev/urandom > test-files/large-file.bin |
61 | 62 |
|
62 | 63 | # Create files with special characters |
|
66 | 67 | echo "📁 Created test files:" |
67 | 68 | find test-files -type f -exec ls -lh {} \; |
68 | 69 |
|
| 70 | + - name: Create large files for big file testing |
| 71 | + if: inputs.test_type == 'large-file-test' |
| 72 | + run: | |
| 73 | + echo "🏗️ Creating large test files..." |
| 74 | +
|
| 75 | + # Check available disk space |
| 76 | + echo "💾 Available disk space:" |
| 77 | + df -h . |
| 78 | +
|
| 79 | + # Create a 1.2GB file for testing large file uploads |
| 80 | + # Using dd with sparse file creation for efficiency |
| 81 | + echo "📦 Creating 1.2GB test file..." |
| 82 | + dd if=/dev/zero of=test-files/huge-file-1.2gb.bin bs=1M count=1200 status=progress |
| 83 | +
|
| 84 | + # Create a 2.5GB file for extreme testing (if space allows) |
| 85 | + if [ $(df . | tail -1 | awk '{print $4}') -gt 3000000 ]; then |
| 86 | + echo "📦 Creating 2.5GB test file..." |
| 87 | + dd if=/dev/zero of=test-files/massive-file-2.5gb.bin bs=1M count=2500 status=progress |
| 88 | + else |
| 89 | + echo "⚠️ Insufficient disk space for 2.5GB file, skipping..." |
| 90 | + fi |
| 91 | +
|
| 92 | + # Create some medium-large files too |
| 93 | + echo "📦 Creating additional large files..." |
| 94 | + dd if=/dev/urandom of=test-files/random-500mb.bin bs=1M count=500 status=progress |
| 95 | + dd if=/dev/zero of=test-files/zeros-800mb.bin bs=1M count=800 status=progress |
| 96 | +
|
| 97 | + echo "📊 Large file summary:" |
| 98 | + ls -lh test-files/*.bin |
| 99 | + echo "" |
| 100 | + echo "💾 Disk space after creation:" |
| 101 | + df -h . |
| 102 | +
|
69 | 103 | - name: Test - Dry Run |
70 | 104 | if: inputs.test_type == 'dry-run' |
71 | 105 | uses: ./ |
@@ -141,6 +175,39 @@ jobs: |
141 | 175 | headers: '{"Cache-Control":"max-age=3600","Content-Type":"text/html"}' |
142 | 176 | continue-on-error: true |
143 | 177 |
|
| 178 | + - name: Test - Large File Upload (>1GB) |
| 179 | + if: inputs.test_type == 'large-file-test' |
| 180 | + uses: ./ |
| 181 | + with: |
| 182 | + region: ${{ env.OSS_REGION }} |
| 183 | + access-key: ${{ env.OSS_ACCESS_KEY }} |
| 184 | + secret-key: ${{ env.OSS_SECRET_KEY }} |
| 185 | + bucket: ${{ env.OSS_BUCKET }} |
| 186 | + assets: | |
| 187 | + test-files/huge-file-1.2gb.bin:large-files/huge-1.2gb.bin |
| 188 | + test-files/random-500mb.bin:large-files/random-500mb.bin |
| 189 | + test-files/zeros-800mb.bin:large-files/zeros-800mb.bin |
| 190 | + timeout: 1800 |
| 191 | + max-retries: 3 |
| 192 | + enable-gzip: false |
| 193 | + continue-on-error: true |
| 194 | + |
| 195 | + - name: Test - Massive File Upload (2.5GB if available) |
| 196 | + if: inputs.test_type == 'large-file-test' |
| 197 | + uses: ./ |
| 198 | + with: |
| 199 | + region: ${{ env.OSS_REGION }} |
| 200 | + access-key: ${{ env.OSS_ACCESS_KEY }} |
| 201 | + secret-key: ${{ env.OSS_SECRET_KEY }} |
| 202 | + bucket: ${{ env.OSS_BUCKET }} |
| 203 | + assets: | |
| 204 | + test-files/massive-file-2.5gb.bin:extreme-files/massive-2.5gb.bin |
| 205 | + timeout: 3600 |
| 206 | + max-retries: 2 |
| 207 | + enable-gzip: false |
| 208 | + continue-on-error: true |
| 209 | + continue-on-error: true |
| 210 | + |
144 | 211 | - name: Test - Custom Assets |
145 | 212 | if: inputs.custom_assets != '' |
146 | 213 | uses: ./ |
|
0 commit comments