Skip to content

Commit ea0098f

Browse files
committed
ci: add large file upload tests and refactor GitHub Actions
- Add large file upload tests for files > 1GB - Create massive 2.5GB file if disk space allows - Implement efficient sparse file creation using dd - Check available disk space before creating large files - Update test action to include new large file test type - Rename workflow files for better clarity Signed-off-by: diverger <[email protected]>
1 parent 6e09478 commit ea0098f

File tree

6 files changed

+72
-5
lines changed

6 files changed

+72
-5
lines changed

.github/workflows/test-action.yml renamed to .github/workflows/action-test.yml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'multiple-files'
1313
- 'directory-upload'
1414
- 'advanced-options'
15+
- 'large-file-test'
1516
- 'dry-run'
1617
default: 'dry-run'
1718
region:
@@ -56,7 +57,7 @@ jobs:
5657
echo "Configuration file content" > test-files/config/app.json
5758
echo "Binary-like content" > test-files/images/logo.png
5859
59-
# Create a larger file for testing
60+
# Create a larger file for testing (1KB)
6061
head -c 1024 /dev/urandom > test-files/large-file.bin
6162
6263
# Create files with special characters
@@ -66,6 +67,39 @@ jobs:
6667
echo "📁 Created test files:"
6768
find test-files -type f -exec ls -lh {} \;
6869
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+
69103
- name: Test - Dry Run
70104
if: inputs.test_type == 'dry-run'
71105
uses: ./
@@ -141,6 +175,39 @@ jobs:
141175
headers: '{"Cache-Control":"max-age=3600","Content-Type":"text/html"}'
142176
continue-on-error: true
143177

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+
144211
- name: Test - Custom Assets
145212
if: inputs.custom_assets != ''
146213
uses: ./
File renamed without changes.

dist/index.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/types.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/uploader.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/utils.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)