Skip to content

Commit

Permalink
CI: compute individual binary sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
miles170 committed Apr 4, 2023
1 parent a778786 commit 748440b
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -572,15 +572,32 @@ jobs:
shell: bash
run: |
## Compute uutil release sizes
SIZE=$(du -s target/size-release/usr/local/bin/|awk '{print $1}')
SIZE_MULTI=$(du -s target/size-multi-release/usr/local/bin/|awk '{print $1}')
DATE=$(date --rfc-email)
find target/size-release/usr/local/bin -type f -printf '%f\0' | sort -z |
while IFS= read -r -d '' name; do
size=$(du -s target/size-release/usr/local/bin/$name | awk '{print $1}')
echo "\"$name\""
echo "$size"
done | \
jq -n \
--arg date "$DATE" \
--arg sha "$GITHUB_SHA" \
'reduce inputs as $name ({}; . + { ($name): input }) | { ($date): map_values({ sha: $sha, size: . }) }' > individual-size-result.json
SIZE=$(cat individual-size-result.json | jq '[last(.[]) | .[] | .size] | reduce .[] as $num (0; .+$num)')
SIZE_MULTI=$(du -s target/size-multi-release/usr/local/bin/coreutils | awk '{print $1}')
jq -n \
--arg date "$(date --rfc-email)" \
--arg date "$DATE" \
--arg sha "$GITHUB_SHA" \
--arg size "$SIZE" \
--arg multisize "$SIZE_MULTI" \
'{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
- uses: actions/upload-artifact@v3
- name: Upload the individual size result
uses: actions/upload-artifact@v3
with:
name: individual-size-result
path: individual-size-result.json
- name: Upload the size result
uses: actions/upload-artifact@v3
with:
name: size-result
path: size-result.json
Expand Down

0 comments on commit 748440b

Please sign in to comment.