Skip to content

Commit 6a47454

Browse files
(PTFE-3070) Add multi part upload for large file
1 parent 90c9a4e commit 6a47454

File tree

7 files changed

+1964
-1853
lines changed

7 files changed

+1964
-1853
lines changed

.github/workflows/test-upload.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,33 @@ jobs:
6767
- name: Compare files
6868
run: cmp --silent upload_big_file.txt ./big_file.txt
6969

70+
test-upload-multipart:
71+
runs-on: ubuntu-latest
72+
environment: ${{ inputs.environment || 'production' }}
73+
name: Upload a file above the 100 MB multipart threshold and verify integrity
74+
steps:
75+
- uses: actions/checkout@v3
76+
- name: Create a 110 MB file (above 100 MB multipart threshold)
77+
run: dd if=/dev/urandom of=multipart_file.bin count=110 bs=1M
78+
- name: Upload via action (triggers multipart path)
79+
id: artifacts-upload
80+
uses: ./
81+
with:
82+
url: ${{ vars.ARTIFACTS_URL }}
83+
user: ${{ secrets.ARTIFACTS_USER }}
84+
password: ${{ secrets.ARTIFACTS_PASSWORD }}
85+
source: ./multipart_file.bin
86+
method: upload
87+
- name: Download file
88+
run: curl -u ${{ secrets.ARTIFACTS_USER }}:${{ secrets.ARTIFACTS_PASSWORD }} --silent --fail --show-error --max-time 3600 ${{ steps.artifacts-upload.outputs.link }}/multipart_file.bin > downloaded_file.bin
89+
- name: Compare files byte-for-byte
90+
run: cmp --silent multipart_file.bin downloaded_file.bin
91+
7092
push-artifacts-action:
7193
runs-on: ubuntu-latest
7294
environment: ${{ inputs.environment || 'production' }}
7395
name: A job that push single files on artifacts
74-
needs: [test-upload-big-file, test-upload-multiple-files]
96+
needs: [test-upload-big-file, test-upload-multiple-files, test-upload-multipart]
7597
steps:
7698
- uses: actions/checkout@v3
7799
- id: artifacts-upload

0 commit comments

Comments
 (0)