Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

ci: regenerate the Cloud Storage workflow after two PRs crossed (#9890)

teo2840c628e6b0
diff --git a/.github/workflows/code_check_cloud_storage.yml b/.github/workflows/code_check_cloud_storage.yml
index e221e57721..314cdaa02d 100644
--- a/.github/workflows/code_check_cloud_storage.yml
+++ b/.github/workflows/code_check_cloud_storage.yml
@@ -1149,8 +1149,29 @@ jobs:
exit 0
fi
+ # Installing node_modules is most of a build and changes far less often than the SDK,
+ # so it has its own entry.
+ modules="$(nix eval --raw .#macro-js-node-modules.outPath)"
+ modules_url="$SCCACHE_WEBDAV_ENDPOINT/code-mode-assets/$(basename "$modules").zst"
+ save_modules=false
+
+ if ! nix-store --check-validity "$modules" 2>/dev/null; then
+ # No retries: a retry would restart the stream into the same pipe, and past the limit
+ # a rebuild is faster.
+ if cache_request --retry 0 --max-time 60 "$modules_url" | zstd -d | nix-store --import; then
+ echo "node_modules restored from the remote cache"
+ else
+ save_modules=true
+ fi
+ fi
+
nix build --no-link --print-build-logs .#code-mode-assets
+ if [ "$save_modules" = true ] \
+ && ! nix-store --export "$modules" | zstd -T0 -3 | cache_request --max-time 120 --upload-file - "$modules_url"; then
+ echo "::warning::Could not save node_modules to the remote cache"
+ fi
+
# Losing the upload costs the next job a rebuild, not a failure.
if nix-store --export "$assets" | gzip | cache_request --upload-file - "$cache_url"; then
echo "Code-mode assets saved to the remote cache"