diff --git a/packages/ckeditor5-dev-ci/bin/allocate-swap-memory.sh b/packages/ckeditor5-dev-ci/bin/allocate-swap-memory.sh new file mode 100755 index 000000000..f616c4b11 --- /dev/null +++ b/packages/ckeditor5-dev-ci/bin/allocate-swap-memory.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. +# For licensing, see LICENSE.md. + +echo "Allocating swap memory to prevent running out of RAM." + +# Remove existing swap so that allocating new swap does not throw. +sudo swapoff -a + +# Create a 4 gigabyte swapfile. +sudo fallocate -l 4G /swapfile + +# Secure the swapfile by restricting access to root. +sudo chmod 600 /swapfile + +# Mark the file as a swap space. +sudo mkswap /swapfile + +# Enable the swap. +sudo swapon /swapfile diff --git a/packages/ckeditor5-dev-ci/bin/install-latest-chrome.sh b/packages/ckeditor5-dev-ci/bin/install-latest-chrome.sh new file mode 100755 index 000000000..7587a7b87 --- /dev/null +++ b/packages/ckeditor5-dev-ci/bin/install-latest-chrome.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. +# For licensing, see LICENSE.md. + +echo "Installing the latest Chrome." + +sudo apt-get update +sudo apt-get install lsb-release libappindicator3-1 +curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +sudo dpkg -i google-chrome.deb +sudo sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome +rm google-chrome.deb diff --git a/packages/ckeditor5-dev-ci/package.json b/packages/ckeditor5-dev-ci/package.json index b87292aaf..d2d1ee403 100644 --- a/packages/ckeditor5-dev-ci/package.json +++ b/packages/ckeditor5-dev-ci/package.json @@ -24,7 +24,9 @@ "bin": { "ckeditor5-dev-ci-notify-travis-status": "bin/notify-travis-status.js", "ckeditor5-dev-ci-notify-circle-status": "bin/notify-circle-status.js", - "ckeditor5-dev-ci-circle-workflow-notifier": "bin/circle-workflow-notifier.js" + "ckeditor5-dev-ci-circle-workflow-notifier": "bin/circle-workflow-notifier.js", + "ckeditor5-dev-ci-allocate-swap-memory": "bin/allocate-swap-memory.sh", + "ckeditor5-dev-ci-install-latest-chrome": "bin/install-latest-chrome.sh" }, "author": "CKSource (http://cksource.com/)", "license": "GPL-2.0-or-later",