Skip to content

Commit

Permalink
Merge pull request #914 from ckeditor/ci/3510-circleci
Browse files Browse the repository at this point in the history
Other (ci): Introduced the `ckeditor5-dev-ci-allocate-swap-memory` binary script for allocating the SWAP memory to avoid issues with running out of RAM.

Other (ci): Introduced the `ckeditor5-dev-ci-install-latest-chrome` binary script for installing the latest Chrome browser.
  • Loading branch information
pomek authored Aug 18, 2023
2 parents baf3340 + ce799ad commit d4cff5e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
21 changes: 21 additions & 0 deletions packages/ckeditor5-dev-ci/bin/allocate-swap-memory.sh
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions packages/ckeditor5-dev-ci/bin/install-latest-chrome.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion packages/ckeditor5-dev-ci/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d4cff5e

Please sign in to comment.