fix(action): re-enable extra logs
Some logs where hidden, we can now put them into groups instead (and figure out why this is failing T-T.
This commit is contained in:
parent
fd5476dc11
commit
bff5365c60
1 changed files with 14 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
@ -7,32 +7,36 @@ util_path="${GITHUB_ACTION_PATH-.}/utils.sh"
|
||||||
# shellcheck source=utils.sh
|
# shellcheck source=utils.sh
|
||||||
. "${util_path}"
|
. "${util_path}"
|
||||||
|
|
||||||
log 'Retrieving Flake information'
|
group 'Retrieving Flake information'
|
||||||
flake_info=$(nix flake show --json 2>/dev/null)
|
flake_info=$(nix flake show --json)
|
||||||
|
endgroup
|
||||||
|
|
||||||
|
group 'Show Packages'
|
||||||
packages=$(
|
packages=$(
|
||||||
jq --raw-output '.packages."x86_64-linux" | select(. != null) | keys[]' <<-EOF
|
jq --raw-output '.packages."x86_64-linux" | select(. != null) | keys[]' <<-EOF
|
||||||
$flake_info
|
$flake_info
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
group 'Show Packages'
|
|
||||||
log "$packages"
|
log "$packages"
|
||||||
endgroup
|
endgroup
|
||||||
|
|
||||||
|
group 'Show NixOS Configurations'
|
||||||
configurations=$(
|
configurations=$(
|
||||||
jq --raw-output '.nixosConfigurations | select(. != null) | keys[]' <<-EOF
|
jq --raw-output '.nixosConfigurations | select(. != null) | keys[]' <<-EOF
|
||||||
$flake_info
|
$flake_info
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
group 'Show NixOS Configurations'
|
|
||||||
log "$configurations"
|
log "$configurations"
|
||||||
endgroup
|
endgroup
|
||||||
|
|
||||||
pkgs_json() {
|
pkgs_json() {
|
||||||
group 'Building packages'
|
group 'Building packages'
|
||||||
|
trap endgroup RETURN
|
||||||
for package in $packages; do
|
for package in $packages; do
|
||||||
log "Building $package"
|
log "Building $package"
|
||||||
path=$(nix build --print-out-paths ".#$package" 2>/dev/null)
|
path=$(nix build --print-out-paths ".#$package")
|
||||||
log "Calculating size of $package"
|
log "Calculating size of $package"
|
||||||
nix path-info --closure-size --json "$path" 2>/dev/null |
|
nix path-info --closure-size --json "$path" |
|
||||||
jq --compact-output --arg pkg "$package" '.[] | {"name": $pkg, "size": .closureSize, "narSize": .narSize}'
|
jq --compact-output --arg pkg "$package" '.[] | {"name": $pkg, "size": .closureSize, "narSize": .narSize}'
|
||||||
done
|
done
|
||||||
endgroup
|
endgroup
|
||||||
|
@ -40,14 +44,14 @@ pkgs_json() {
|
||||||
|
|
||||||
configs_json() {
|
configs_json() {
|
||||||
group 'Building NixOS configurations'
|
group 'Building NixOS configurations'
|
||||||
|
trap endgroup RETURN
|
||||||
for config in $configurations; do
|
for config in $configurations; do
|
||||||
log "Building $config"
|
log "Building $config"
|
||||||
path=$(nix build --print-out-paths ".#nixosConfigurations.$config.config.system.build.toplevel" 2>/dev/null)
|
path=$(nix build --print-out-paths ".#nixosConfigurations.$config.config.system.build.toplevel")
|
||||||
log "Calculating size of $config"
|
log "Calculating size of $config"
|
||||||
nix path-info --closure-size --json "$path" 2>/dev/null |
|
nix path-info --closure-size --json "$path" |
|
||||||
jq --compact-output --arg pkg "$config" '.[] | {"name": $pkg, "size": .closureSize, "narSize": .narSize}'
|
jq --compact-output --arg pkg "$config" '.[] | {"name": $pkg, "size": .closureSize, "narSize": .narSize}'
|
||||||
done
|
done
|
||||||
endgroup
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgs=$(pkgs_json | jq --slurp '.')
|
pkgs=$(pkgs_json | jq --slurp '.')
|
||||||
|
|
Loading…
Reference in a new issue