From 0df2166cf277402be6bd87e82332e1b423ca5e53 Mon Sep 17 00:00:00 2001 From: Santeri Hannula Date: Thu, 25 Jul 2024 15:11:27 +0300 Subject: [PATCH] actions: set swap on linux --- .github/workflows/shared.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/shared.yml b/.github/workflows/shared.yml index ddfb757a5c..eb3eed74a8 100644 --- a/.github/workflows/shared.yml +++ b/.github/workflows/shared.yml @@ -56,6 +56,27 @@ jobs: # - uses: actions/checkout@v3 + - name: Set swap space + if: ${{ matrix.target == 'linux-x86_64' || matrix.target == 'linux-aarch64'}} + run: | + echo "Memory and swap:" + free -h + echo + swapon --show + echo + export SWAP_FILE=$(swapon --show=NAME | tail -n 1) + sudo swapoff $SWAP_FILE + sudo rm $SWAP_FILE + sudo fallocate -l 10G $SWAP_FILE + sudo chmod 600 $SWAP_FILE + sudo mkswap $SWAP_FILE + sudo swapon $SWAP_FILE + echo "Memory and swap:" + free -h + echo + swapon --show + echo + - name: chown /usr/local if: ${{ matrix.target == 'linux-x86_64' || matrix.target == 'linux-aarch64'}} run: |