diff --git a/.github/workflows/upload-artifact-test-single-upload.yml b/.github/workflows/upload-artifact-test-single-upload.yml new file mode 100644 index 0000000..d101a4e --- /dev/null +++ b/.github/workflows/upload-artifact-test-single-upload.yml @@ -0,0 +1,30 @@ +# Workflow to test upload-artifact action with 501 files in a single upload +# This tests the 500 file limit mentioned in https://github.com/actions/upload-artifact + +name: Upload Artifact Test - Single Upload + +# Controls when the action will run. Workflow runs when manually triggered using the UI or API. +on: + workflow_dispatch: + +jobs: + test-single-upload: + name: Test uploading 501 files in a single upload-artifact step + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Create 501 test files + run: | + mkdir -p test-files + for i in {1..501}; do + echo "This is test file number $i" > test-files/file-$i.txt + done + echo "Created $(ls test-files | wc -l) files" + + - name: Upload all 501 files in a single step + uses: actions/upload-artifact@v4 + with: + name: test-501-files-single-upload + path: test-files/ diff --git a/.github/workflows/upload-artifact-test-split-upload.yml b/.github/workflows/upload-artifact-test-split-upload.yml new file mode 100644 index 0000000..0ead30b --- /dev/null +++ b/.github/workflows/upload-artifact-test-split-upload.yml @@ -0,0 +1,48 @@ +# Workflow to test upload-artifact action with 501 files split into 2 uploads +# This tests the 500 file limit mentioned in https://github.com/actions/upload-artifact + +name: Upload Artifact Test - Split Upload + +# Controls when the action will run. Workflow runs when manually triggered using the UI or API. +on: + workflow_dispatch: + +jobs: + test-split-upload: + name: Test uploading 501 files in two separate upload-artifact steps + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Create 501 test files + run: | + mkdir -p test-files + for i in {1..501}; do + echo "This is test file number $i" > test-files/file-$i.txt + done + echo "Created $(ls test-files | wc -l) files" + + - name: Create directories for split upload + run: | + mkdir -p test-files-part1 test-files-part2 + for i in {1..250}; do + cp test-files/file-$i.txt test-files-part1/ + done + for i in {251..501}; do + cp test-files/file-$i.txt test-files-part2/ + done + echo "Part 1 has $(ls test-files-part1 | wc -l) files" + echo "Part 2 has $(ls test-files-part2 | wc -l) files" + + - name: Upload files 1-250 + uses: actions/upload-artifact@v4 + with: + name: test-501-files-split-upload-part1 + path: test-files-part1/ + + - name: Upload files 251-501 + uses: actions/upload-artifact@v4 + with: + name: test-501-files-split-upload-part2 + path: test-files-part2/ diff --git a/.github/workflows/upload-artifact-test-zipped.yml b/.github/workflows/upload-artifact-test-zipped.yml new file mode 100644 index 0000000..f6a5978 --- /dev/null +++ b/.github/workflows/upload-artifact-test-zipped.yml @@ -0,0 +1,35 @@ +# Workflow to test upload-artifact action with 501 files zipped into a single file +# This tests the 500 file limit mentioned in https://github.com/actions/upload-artifact + +name: Upload Artifact Test - Zipped Upload + +# Controls when the action will run. Workflow runs when manually triggered using the UI or API. +on: + workflow_dispatch: + +jobs: + test-zipped-upload: + name: Test uploading 501 files as a single zip file + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Create 501 test files + run: | + mkdir -p test-files + for i in {1..501}; do + echo "This is test file number $i" > test-files/file-$i.txt + done + echo "Created $(ls test-files | wc -l) files" + + - name: Zip all files + run: | + zip -r test-files.zip test-files/ + echo "Zip file created: $(ls -lh test-files.zip)" + + - name: Upload zip file + uses: actions/upload-artifact@v4 + with: + name: test-501-files-zipped + path: test-files.zip