ci: cache elc binary + Docker layers, asset changes from 42min to ~5min
Deploy marketing to Cloud Run / deploy (push) Has been cancelled

- deploy.yaml: restore elc from GCS (gs://neuron-ci-cache) keyed on
  source SHA; only compile on cache miss, then upload for future runs
- Dockerfile.stage: pre-compile el_runtime.o as its own layer so the
  expensive object is cached when only main.c changes between runs
- build-stage.sh: add --cache-from/--cache-to pointing at Artifact
  Registry so apt-get + compilation layers survive across cold builds
This commit is contained in:
Will Anderson
2026-05-02 17:30:18 -05:00
parent 2e73fce3b3
commit a185b8ae69
3 changed files with 32 additions and 3 deletions
+7 -2
View File
@@ -25,6 +25,11 @@ WORKDIR /build
# El runtime (shared by both binaries)
COPY runtime/el_runtime.c runtime/el_runtime.h ./
# Pre-compile el_runtime as a separate cached layer.
# el_runtime.c changes rarely; main.c changes every run.
# Splitting this out means el_runtime.o is cached across builds when only main.c changes.
RUN cc -O2 -c el_runtime.c -I. -o el_runtime.o
# ── Build neuron-web ──────────────────────────────────────────────────────────
#
# main.c was generated on the host by build-stage.sh from src/*.el via the
@@ -35,7 +40,7 @@ COPY dist/main.c ./
RUN cc -O2 -rdynamic \
-o neuron-web \
main.c web_stubs.c el_runtime.c \
main.c web_stubs.c el_runtime.o \
-lcurl -lpthread -ldl -lm -lssl -lcrypto
# ── Build soul-demo ───────────────────────────────────────────────────────────
@@ -44,7 +49,7 @@ COPY dist/vessel_stubs.c ./
RUN cc -O2 -rdynamic \
-o soul-demo \
soul-demo.c vessel_stubs.c el_runtime.c \
soul-demo.c vessel_stubs.c el_runtime.o \
-lcurl -lpthread -ldl -lm -lssl -lcrypto
# ── Stage 2: runtime image ────────────────────────────────────────────────────