Skip to content

Commit

Permalink
Faster builds by limiting visible CPUs
Browse files Browse the repository at this point in the history
As described in this elm compiler issue:
elm/compiler#1473
  • Loading branch information
davcamer committed Aug 12, 2018
1 parent 8c189ac commit 43812b9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ addons:
env:
- TRAVIS_NODE_VERSION="v7.2.1"

cache:
directories:
- sysconfcpus
- protoc

before_install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- ./install_sysconfcpus
- ./install_protobuf

install:
- ./install_protobuf
- export PATH=$PATH:$PWD/protoc/bin
- go get -t -v ./protoc-gen-elm
- protoc --version
- node --version
- npm --version
- npm install -g elm
- npm install -g elm-test
- mv $(npm config get prefix)/bin/elm-make $(npm config get prefix)/bin/elm-make-old
- printf '%s\n\n' '#!/bin/bash' 'echo "Running elm-make with sysconfcpus -n 2"' '$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make-old "$@"' > $(npm config get prefix)/bin/elm-make
- chmod +x $(npm config get prefix)/bin/elm-make

script: ./run_tests
13 changes: 13 additions & 0 deletions install_sysconfcpus
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -ex

echo "Install libsysconfcpus to compensate for slow elm builds"
# More at: https://github.com/elm/compiler/issues/1473
if [ ! -d sysconfcpus/bin ]; then
git clone https://github.com/obmarg/libsysconfcpus.git
cd libsysconfcpus
./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus
make && make install
cd ..
fi

0 comments on commit 43812b9

Please sign in to comment.