From 23ccac2b1e9fa646083908656753188d3769040f Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Thu, 18 Dec 2025 14:08:47 -0300 Subject: [PATCH] CI: add swap and staged build to prevent OOM --- .forgejo/workflows/botserver.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/botserver.yaml b/.forgejo/workflows/botserver.yaml index fddbf81d..6ce67cc0 100644 --- a/.forgejo/workflows/botserver.yaml +++ b/.forgejo/workflows/botserver.yaml @@ -35,6 +35,15 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-botserver- + - name: Setup swap for low-memory builds + run: | + sudo fallocate -l 4G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 + sudo chmod 600 /swapfile + sudo mkswap /swapfile + sudo swapon /swapfile + echo "Swap enabled:" + free -h + - name: Install system dependencies run: | sudo apt-get update @@ -50,9 +59,12 @@ jobs: - name: Setup environment run: sudo cp /opt/gbo/bin/system/.env . || true - - name: Build Linux x86_64 + - name: Build Linux x86_64 (minimal features first) run: | export PATH="$HOME/.cargo/bin:$PATH" + # Build dependencies first with minimal features to cache them + cargo build --locked --no-default-features --features "chat,cache,tasks" 2>&1 || true + # Then build with all default features cargo build --locked 2>&1 | tee /tmp/botserver-build.log echo "Build exit code: $?" tail -100 /tmp/botserver-build.log