CI: add swap and staged build to prevent OOM
This commit is contained in:
parent
7600620224
commit
23ccac2b1e
1 changed files with 13 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue