Skip to content

Commit

Permalink
[Travis] Set Composer memory limit and enabled swap
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Jul 16, 2020
1 parent 6df8f1a commit d037dc8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ cache:
directories:
- $HOME/.composer/cache/files

env:
global:
- COMPOSER_MEMORY_LIMIT=6G

matrix:
include:
- php: 5.6
Expand Down Expand Up @@ -39,6 +43,7 @@ before_script:
- composer config -g github-oauth.github.com "d0285ed5c8644f30547572ead2ed897431c1fc09"
# Avoid memory issues on composer install
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- ./bin/.travis/enable_swap.sh
- if [ "$COMPOSER_REQUIRE" != "" ] ; then composer require --no-update $COMPOSER_REQUIRE ; fi
- travis_retry composer update --prefer-dist --no-interaction
- if [ "$SOLR_VERSION" != "" ] ; then ./bin/.travis/init_solr.sh ; fi
Expand Down
6 changes: 6 additions & 0 deletions bin/.travis/enable_swap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo '> Enabling swap...'
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1

0 comments on commit d037dc8

Please sign in to comment.