configuration.nix/ci-scripts/report-size.sh

19 lines
578 B
Bash
Raw Normal View History

create_table() {
# we want to split the words as each of them is a different installable
# shellcheck disable=SC2046
table=$(nix path-info --size --closure-size --human-readable \
$(nix flake show --json 2>/dev/null | jq --raw-output '.packages."x86_64-linux" | ".#" + keys[]') |
sed 's/^\(\S\+\)\(\s\+\)\(\S\+\)\(\s\+\)\(\S\+\)$/| \1\2| \3 | \4\5 |/')
cat <<-EOF
| Nix Store Path | NAR Size | Closure Size |
|----------------|---------:|-------------:|
$table
EOF
}
tea login add --url "$GITHUB_SERVER_URL" --token "$GITHUB_TOKEN"
tea pulls list
create_table