Skip to content

Commit

Permalink
actions: set swap on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ripperi committed Jul 25, 2024
1 parent 1b4c2eb commit d01d1d4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,33 @@ 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)
if test -z "${SWAP_FILE}"; then
export SWAP_FILE=/swapfile
else
sudo swapoff -a
sudo rm "${SWAP_FILE}"
fi
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: |
Expand Down

0 comments on commit d01d1d4

Please sign in to comment.