Skip to content

Commit

Permalink
Circle CI: Emscripten build
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Sep 15, 2017
1 parent 7dd372c commit 48e0e3b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 16 deletions.
48 changes: 44 additions & 4 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
version: 2
jobs:
build:
branches:
ignore:
- /.*/
docker:
- image: trzeci/emscripten:sdk-tag-1.37.18-64bit
- image: trzeci/emscripten:sdk-tag-1.37.21-64bit
steps:
- checkout
- run:
name: Install external tests deps
command: |
apt-get -qq update
apt-get -qy install netcat curl
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | NVM_DIR=/usr/local/nvm bash
- run:
name: Test external tests deps
command: |
export NVM_DIR="/usr/local/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm --version
nvm install 6
node --version
npm --version
- run:
name: Init submodules
command: |
git submodule update --init
- restore_cache:
name: Restore Boost build
key: &boost-cache-key emscripten-boost-{{ checksum "scripts/travis-emscripten/install_deps.sh" }}{{ checksum "scripts/travis-emscripten/build_emscripten.sh" }}
- run:
name: Bootstrap Boost
command: |
scripts/travis-emscripten/install_deps.sh
- run:
name: Build
command: |
scripts/travis-emscripten/build_emscripten.sh
- save_cache:
name: Save Boost build
key: *boost-cache-key
paths:
- boost_1_57_0
- run:
name: Test
command: |
. /usr/local/nvm/nvm.sh
scripts/test_emscripten.sh
- store_artifacts:
path: build/solc/soljson.js
destination: soljson.js
2 changes: 1 addition & 1 deletion scripts/build_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ set -e

if [[ "$OSTYPE" != "darwin"* ]]; then
./scripts/travis-emscripten/install_deps.sh
docker run -v $(pwd):/src trzeci/emscripten:sdk-tag-1.35.4-64bit ./scripts/travis-emscripten/build_emscripten.sh
docker run -v $(pwd):/root/project -w /root/project trzeci/emscripten:sdk-tag-1.35.4-64bit ./scripts/travis-emscripten/build_emscripten.sh
fi
16 changes: 9 additions & 7 deletions scripts/travis-emscripten/build_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@

set -ev

# We need git for extracting the commit hash
apt-get update
apt-get -y install git-core
if ! type git &>/dev/null; then
# We need git for extracting the commit hash
apt-get update
apt-get -y install git-core
fi

export WORKSPACE=/src
WORKSPACE=/root/project

# Boost
echo -en 'travis_fold:start:compiling_boost\\r'
cd "$WORKSPACE"/boost_1_57_0
# if b2 exists, it is a fresh checkout, otherwise it comes from the cache
# and is already compiled
test -e b2 && (
sed -i 's|using gcc ;|using gcc : : /usr/local/bin/em++ ;|g' ./project-config.jam
sed -i 's|$(archiver\[1\])|/usr/local/bin/emar|g' ./tools/build/src/tools/gcc.jam
sed -i 's|$(ranlib\[1\])|/usr/local/bin/emranlib|g' ./tools/build/src/tools/gcc.jam
sed -i 's|using gcc ;|using gcc : : em++ ;|g' ./project-config.jam
sed -i 's|$(archiver\[1\])|emar|g' ./tools/build/src/tools/gcc.jam
sed -i 's|$(ranlib\[1\])|emranlib|g' ./tools/build/src/tools/gcc.jam
./b2 link=static variant=release threading=single runtime-link=static \
system regex filesystem unit_test_framework program_options
find . -name 'libboost*.a' -exec cp {} . \;
Expand Down
6 changes: 2 additions & 4 deletions scripts/travis-emscripten/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ set -ev

echo -en 'travis_fold:start:installing_dependencies\\r'
test -e boost_1_57_0 -a -e boost_1_57_0/boost || (
wget 'http://downloads.sourceforge.net/project/boost/boost/'\
'1.57.0/boost_1_57_0.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2F'\
'projects%2Fboost%2Ffiles%2Fboost%2F1.57.0%2F&ts=1421887207'\
-O - | tar xj
wget 'https://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/download'\
-O - | tar xz
cd boost_1_57_0
./bootstrap.sh --with-toolset=gcc --with-libraries=thread,system,regex,date_time,chrono,filesystem,program_options,random
)
Expand Down

0 comments on commit 48e0e3b

Please sign in to comment.