ci: make env probes non-fatal, swap free for /proc/meminfo
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
Pipeline #41 died with exit 127 on `free -h` — procps isn't in the nix-ci image. New info() helper runs the command and ignores the exit code, so missing tools no longer abort the build. Also switched to /proc/meminfo since it's always available on Linux.
This commit is contained in:
+10
-4
@@ -13,6 +13,12 @@ def run(cmd):
|
||||
sys.exit(r.returncode)
|
||||
|
||||
|
||||
def info(cmd):
|
||||
"""Like run(), but tolerant of failure — for non-load-bearing diagnostics."""
|
||||
print(f"+ {cmd}", flush=True)
|
||||
subprocess.run(cmd, shell=True)
|
||||
|
||||
|
||||
def build(cmd):
|
||||
"""Run a `nix build`, streaming stderr live; return stdout (the out path)."""
|
||||
print(f"+ {cmd}", flush=True)
|
||||
@@ -31,10 +37,10 @@ ATTIC_TOKEN = os.environ["ATTIC_TOKEN"]
|
||||
print(f"=== Building flake-hub packages for {ARCH} ===")
|
||||
|
||||
# Environment context for log readers
|
||||
run("nix --version")
|
||||
run("uname -a")
|
||||
run("df -h /nix 2>/dev/null || df -h /")
|
||||
run("free -h")
|
||||
info("nix --version")
|
||||
info("uname -a")
|
||||
info("df -h /nix 2>/dev/null || df -h /")
|
||||
info("cat /proc/meminfo | head -3")
|
||||
|
||||
# Setup attic
|
||||
attic = (
|
||||
|
||||
Reference in New Issue
Block a user