Skip to content

Commit 83138ef

Browse files
committed
adjust swap to 8gb
1 parent e09c93b commit 83138ef

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,19 @@ jobs:
158158
with:
159159
enable-cache: true
160160

161+
- name: Add extra swap for release build
162+
if: inputs.build_mode == 'release'
163+
run: |
164+
set -euxo pipefail
165+
sudo swapoff -a || true
166+
sudo rm -f /swapfile
167+
sudo fallocate -l 8G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=8192
168+
sudo chmod 600 /swapfile
169+
sudo mkswap /swapfile
170+
sudo swapon /swapfile
171+
free -h
172+
swapon --show
173+
161174
- name: Build (release mode)
162175
uses: PyO3/maturin-action@v1
163176
if: inputs.build_mode == 'release'
@@ -232,7 +245,7 @@ jobs:
232245
set -euxo pipefail
233246
sudo swapoff -a || true
234247
sudo rm -f /swapfile
235-
sudo fallocate -l 16G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=16384
248+
sudo fallocate -l 8G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=8192
236249
sudo chmod 600 /swapfile
237250
sudo mkswap /swapfile
238251
sudo swapon /swapfile

0 commit comments

Comments
 (0)