Skip already-cached packages in CI build-and-cache #43
@@ -61,7 +61,7 @@ jobs:
|
||||
echo "::group::Building $pkg"
|
||||
|
||||
# Check if package is already cached by evaluating its store path and checking the remote
|
||||
OUT_PATH=$(nix build ".#$pkg" --no-link --print-out-paths --dry-run 2>/dev/null | grep '^/nix/store/' | tail -1)
|
||||
OUT_PATH=$(nix eval ".#$pkg.outPath" --raw 2>/dev/null)
|
||||
if [ -n "$OUT_PATH" ] && ssh -i ~/.ssh/cache_key ${{ secrets.CACHE_USER }}@${{ secrets.CACHE_HOST }} \
|
||||
"nix path-info '$OUT_PATH' >/dev/null 2>&1"; then
|
||||
echo "⏭ $pkg already cached ($OUT_PATH), skipping"
|
||||
|
||||
Reference in New Issue
Block a user