@@ -267,7 +267,7 @@ runs:
267267 # ────────────────────────────────────────────────────────────────────────────
268268 - name : 📥 Full checkout for module download (module cache miss)
269269 if : steps.setup-go.outputs.module-cache-hit != 'true'
270- uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
270+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
271271 with :
272272 persist-credentials : false
273273
@@ -306,7 +306,7 @@ runs:
306306 # ────────────────────────────────────────────────────────────────────────────
307307 - name : 📥 Full checkout for build warming (module hit, build miss)
308308 if : steps.setup-go.outputs.module-cache-hit == 'true' && steps.setup-go.outputs.build-cache-hit != 'true'
309- uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
309+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
310310 with :
311311 persist-credentials : false
312312
@@ -319,6 +319,15 @@ runs:
319319 run : |
320320 set -euo pipefail
321321 GO_MODULE_DIR="${{ env.GO_MODULE_DIR }}"
322+ BUILD_STRATEGY="${MAGE_X_BUILD_STRATEGY:-smart}"
323+
324+ # Allow skipping pre-build entirely (useful when packages OOM on standard runners)
325+ if [ "$BUILD_STRATEGY" == "skip" ]; then
326+ echo "⏭️ Build pre-compilation skipped (MAGE_X_BUILD_STRATEGY=skip)"
327+ echo "ℹ️ Module cache is still warmed — build cache will populate on first real build"
328+ exit 0
329+ fi
330+
322331 echo "🔧 Build cache miss - pre-building packages..."
323332
324333 echo "============================================================"
@@ -333,21 +342,21 @@ runs:
333342 echo "🔧 Multi-module mode - running build commands from repository root"
334343 echo "📦 magex will discover all Go modules and pre-build packages"
335344 # Use configured parallelism to avoid OOM on GitHub Actions runners
336- magex build:prebuild p="$PARALLEL_JOBS" strategy="${MAGE_X_BUILD_STRATEGY:-smart }" batch_size="${MAGE_X_BUILD_BATCH_SIZE:-20}" batch_delay="${MAGE_X_BUILD_BATCH_DELAY_MS:-0}" exclude="${MAGE_X_BUILD_EXCLUDE_PATTERN:-}"
345+ magex build:prebuild p="$PARALLEL_JOBS" strategy="${BUILD_STRATEGY }" batch_size="${MAGE_X_BUILD_BATCH_SIZE:-20}" batch_delay="${MAGE_X_BUILD_BATCH_DELAY_MS:-0}" exclude="${MAGE_X_BUILD_EXCLUDE_PATTERN:-}"
337346
338347 echo "🏗️ Building stdlib for host platform..."
339348 magex install:stdlib
340349 elif [ -n "$GO_MODULE_DIR" ]; then
341350 echo "🔧 Running build commands from directory: $GO_MODULE_DIR"
342351 # Use configured parallelism to avoid OOM on GitHub Actions runners
343- (cd "$GO_MODULE_DIR" && magex build:prebuild p="$PARALLEL_JOBS" strategy="${MAGE_X_BUILD_STRATEGY:-smart }" batch_size="${MAGE_X_BUILD_BATCH_SIZE:-20}" batch_delay="${MAGE_X_BUILD_BATCH_DELAY_MS:-0}" exclude="${MAGE_X_BUILD_EXCLUDE_PATTERN:-}")
352+ (cd "$GO_MODULE_DIR" && magex build:prebuild p="$PARALLEL_JOBS" strategy="${BUILD_STRATEGY }" batch_size="${MAGE_X_BUILD_BATCH_SIZE:-20}" batch_delay="${MAGE_X_BUILD_BATCH_DELAY_MS:-0}" exclude="${MAGE_X_BUILD_EXCLUDE_PATTERN:-}")
344353
345354 echo "🏗️ Building stdlib for host platform..."
346355 (cd "$GO_MODULE_DIR" && magex install:stdlib)
347356 else
348357 echo "🔧 Running build commands from repository root"
349358 # Use configured parallelism to avoid OOM on GitHub Actions runners
350- magex build:prebuild p="$PARALLEL_JOBS" strategy="${MAGE_X_BUILD_STRATEGY:-smart }" batch_size="${MAGE_X_BUILD_BATCH_SIZE:-20}" batch_delay="${MAGE_X_BUILD_BATCH_DELAY_MS:-0}" exclude="${MAGE_X_BUILD_EXCLUDE_PATTERN:-}"
359+ magex build:prebuild p="$PARALLEL_JOBS" strategy="${BUILD_STRATEGY }" batch_size="${MAGE_X_BUILD_BATCH_SIZE:-20}" batch_delay="${MAGE_X_BUILD_BATCH_DELAY_MS:-0}" exclude="${MAGE_X_BUILD_EXCLUDE_PATTERN:-}"
351360
352361 echo "🏗️ Building stdlib for host platform..."
353362 magex install:stdlib
@@ -360,7 +369,7 @@ runs:
360369 # ────────────────────────────────────────────────────────────────────────────
361370 - name : 💾 Save Go build cache
362371 if : steps.setup-go.outputs.build-cache-hit != 'true'
363- uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4 .0.2
372+ uses : actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 .0.4
364373 with :
365374 path : |
366375 ~/.cache/go-build
@@ -372,7 +381,7 @@ runs:
372381 # ────────────────────────────────────────────────────────────────────────────
373382 - name : 💾 Save Go module cache
374383 if : steps.setup-go.outputs.module-cache-hit != 'true'
375- uses : actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4 .0.2
384+ uses : actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5 .0.4
376385 with :
377386 path : ~/go/pkg/mod
378387 key : ${{ steps.cache-keys.outputs.module-key }}
@@ -437,7 +446,7 @@ runs:
437446 # --------------------------------------------------------------------
438447 - name : 📤 Upload cache statistics
439448 if : always()
440- uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
449+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
441450 with :
442451 name : cache-stats-${{ inputs.matrix-os }}-${{ inputs.go-version }}
443452 path : cache-stats-*.json
0 commit comments