Skip to content

Instantly share code, notes, and snippets.

@kofigumbs
Last active November 10, 2017 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kofigumbs/a434d214628147955f73ff7a7ce4c22c to your computer and use it in GitHub Desktop.
Save kofigumbs/a434d214628147955f73ff7a7ce4c22c to your computer and use it in GitHub Desktop.
Use sysconfcpus to simulate CPU count on Travis, for use with Elm
#!/usr/bin/env bash
# https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142
#
# Put these lines in your .travis.yml
#
# install:
# - source <(curl -sSL https://gist.githubusercontent.com/hkgumbs/a434d214628147955f73ff7a7ce4c22c/raw)
# - npm install -g elm elm-test elm-format # etc
#
# Then use `elm2` instead of `elm` (or `elm2 test`, etc)
if [ ! -d sysconfcpus/bin ]
then
git clone https://github.com/obmarg/libsysconfcpus.git
pushd libsysconfcpus
./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus
make
make install
popd
fi
elm2() {
$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm "$@"
}
export -f elm2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment