zBuild-testing-chunks #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: zBuild-testing-chunks | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| chunks_make: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # IMPORTANT: run this BEFORE checkout; it mounts over $GITHUB_WORKSPACE | |
| - name: Maximize build space | |
| uses: easimon/maximize-build-space@master | |
| with: | |
| root-reserve-mb: 4125 | |
| temp-reserve-mb: 1950 | |
| swap-size-mb: 2 | |
| remove-dotnet: true | |
| remove-android: true | |
| remove-haskell: true | |
| remove-codeql: true | |
| remove-docker-images: true | |
| - name: Checkout (after mount) | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 1 | |
| submodules: recursive | |
| - name: Quick system info | |
| shell: bash | |
| run: | | |
| echo "Memory and swap:" | |
| sudo free -h | |
| echo | |
| sudo swapon --show || true | |
| echo | |
| echo "Available storage:" | |
| sudo df -h | |
| - name: Prep workspace | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p ./_local | |
| df -h . | |
| - name: Generate 30GB test file | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| BYTES=30000000000 | |
| OUT=./_local/package_image_beforeBoot.tar.flx | |
| # Fast pseudo-random stream: /dev/zero piped into AES-CTR | |
| head -c "${BYTES}" /dev/zero \ | |
| | openssl enc -aes-256-ctr -pass pass:16918050001 -nosalt \ | |
| > "${OUT}" | |
| ls -lh "${OUT}" | |
| stat -c 'size=%s' "${OUT}" | |
| - name: Split into ~1.86 GiB parts (tail+truncate style) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| F=./_local/package_image_beforeBoot.tar.flx | |
| CHUNK=1997537280 # ~1.86 GiB | |
| for i in $(seq -w 0 63); do | |
| [[ -s "$F" ]] || break | |
| tail -c "$CHUNK" "$F" > "$F".part"$i" | |
| size=$(stat -c%s "$F") | |
| if (( size > CHUNK )); then | |
| truncate -s -$CHUNK "$F" | |
| else | |
| truncate -s 0 "$F" | |
| fi | |
| done | |
| echo "Generated parts:" | |
| ls -lh ./_local/package_image_beforeBoot.tar.flx.part* || { echo "No parts produced"; exit 1; } | |
| parts_count=$(ls -1 ./_local/package_image_beforeBoot.tar.flx.part* | wc -l) | |
| echo "parts_count=${parts_count}" | |
| [[ "${parts_count}" -ge 15 ]] | |
| - name: Sanity check (verify ubiquitous_bash.sh is present) | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| pwd | |
| df -h . | |
| ls -l ./ubiquitous_bash.sh || { echo "script missing"; exit 1; } | |
| head -n1 ./ubiquitous_bash.sh || true | |
| - name: Upload parts via ubiquitous_bash | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| bash ./ubiquitous_bash.sh _gh_release_upload_parts-multiple_sequence \ | |
| "build-16918050001-9999" \ | |
| ./_local/package_image_beforeBoot.tar.flx.part* |