Skip to content

Commit

Permalink
Automatically deploy Revelation binaries to GitHub.
Browse files Browse the repository at this point in the history
Remove Slack notification.
Fixes #20.
  • Loading branch information
Sarah Mount committed Jul 22, 2016
1 parent 6c2701d commit 507892b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 32 deletions.
62 changes: 30 additions & 32 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
language: python

python:
- '2.7'

python: '2.7'
cache: pip

env:
- TRANSLATE=true

matrix:
- TRANSLATE=true
global:
- secure: MB+cl/sMrHZEGaMFVYVK1WTGnwq12NMnBAgr4ZLfQAK95R8I2jpVDgKUpyPGnpGpO3rrXi0dQWGpBaWnt8P7JoVxyjKLw1e1F8hReD17/NZY7g34I1T0sqYrlJWxdXXGwfMIiahELr6FmqpIWqPJpDnbSXUPmE6UtWRNDeEa6LOAkog7gK5ZUVUmGZmzMbXC4gnqFRUYLjUHb6djH3dslpASLGTMFXzgvV0ZI0ztyX1xt1ORdEcgr8W32q/2JjfJLvJ2GSYVSORMbFMWP5XbWr8TdwpELBNz/BF7w7cR47GfdXblVmGZ/zwEyuvVre5LFrcVa+rMSY1VP2QvjYP8APYk9AbG/EdTS2QEs3/SDTISvpJziB7dexFuqEc0lB2MVXksbQcBLRoxzdpLDhtpUk1qEPBKkPVJCK5Y75uH3bS1tPtRX24sZx44ApuB1Fb8ql/PS+GVfbq2M1mhU9nNZ4EvVLU22e3AfsZQ4EeSKSbzDXiKG/Bsk5KDr2tPNJsuCsIyr/UwDDTW6Q9ZkTHMK++de2DySqe6bi+eQFIg4PR2+0L4E08XlWd9JjM4hoWuJmoj83snI5lwaUXHPee09LKQSzgMidLt46A/tgkHcjE8Vub0EbkotLL9nitf9QgqhAXN+EsVMNQOz4s5XpB2YvRpB6EtwKV860j55IQkPqY=
install:
- pip install --disable-pip-version-check --upgrade pip
- pip install -r requirements.txt
- cd ${HOME}
- wget https://github.com/cornell-brg/pydgin/archive/master.zip
- unzip master.zip
- mv pydgin-master pydgin

# Download & extract latest PyPy source code
# Exclude bundled versions of pytest, & pytest-cov
- cd ${HOME}
- wget https://bitbucket.org/pypy/pypy/get/default.tar.gz
- tar xf default.tar.gz --transform 's/pypy-pypy-[0-9a-f]\+/pypy/'
--exclude 'pypy-pypy-*/pytest_cov.py'

- cd $TRAVIS_BUILD_DIR
- export PYTHONPATH=${PYTHONPATH}:${HOME}/pydgin/

- pip install --disable-pip-version-check --upgrade pip
- pip install -r requirements.txt
- cd ${HOME}
- wget https://github.com/cornell-brg/pydgin/archive/master.zip
- unzip master.zip
- mv pydgin-master pydgin
- cd ${HOME}
- wget https://bitbucket.org/pypy/pypy/get/default.tar.gz
- tar xf default.tar.gz --transform 's/pypy-pypy-[0-9a-f]\+/pypy/' --exclude 'pypy-pypy-*/pytest_cov.py'
- cd $TRAVIS_BUILD_DIR
- export PYTHONPATH=${PYTHONPATH}:${HOME}/pydgin/
script:
- py.test -n 4 -rxXs --color=yes --doctest-modules --cov-config=.coveragerc --cov-report=term-missing --cov=revelation revelation/test/ scripts/
- test "$TRANSLATE" == "true" && PYTHONPATH=${HOME}/pydgin/:${HOME}/pypy:. ${HOME}/pypy/rpython/bin/rpython --no-pdb --opt=jit revelation/sim.py || true

after_success: coveralls

notifications:
slack:
secure: dBy5lkieNPYSmVhBOKXbHKCpgVJLQiuB0K89JmypE03FpRZSJKv1rwz/LG/herCgNOhwJ3/u/VEMEyfucLrkIYsgJjBcxU+Fby//iRZ9IroLLJr9J/xYG53kaMMsmyvohKSBdgl7IPqkwRRWB58Ac9iOvNmZPYsGwxqCHR7pRbHDiR0GmewdpLIylPFsU3G7Q6yGRdoFzTCawM3TYHwkKQOs1gFkBkAcB6LwxH3ZwIN/8caVm2fwU8Edn7nnzJ6vq/od2W2smgRQPfOwUk5FhEagqYQV7DB4Yu5Kx3wug3lWNEEk95KENnQZ7zU+1NjA7e5EERNvXNmdxNmxnaoZeRxj5mjS8PcERMNQd6i5nWOvWXYHhwBvy9CuZ9xBMr3G4TYLEwAo2SrD31h7pmsoHf9rRGOs9Z8P9/zr54M2G0qHoUoyfhah1c3DwnZBuepRzQzBn4i3eUyBKrLADAMQteGKwxKsWyvQybsomOyfpZA/g1cKLszTMoWNLl6S9OaBLjVTYlncwl3qI8Wvjs/pXICmxPuB0in6rAY3KakWo/6ls+QBlergAFTrPGqCH9MutlHICGfxztRaTPWYWRQnJlze896WVE5oGrtn35AUAWaB6ckQOGAAvnkslD4VQaZXxbrvcK0luszVF8OkFqBlPrFjq0cu+iYoNaTMZGusPyA=
- py.test -n 4 -rxs --color=yes --cov-config .coveragerc --cov-report term-missing
--cov=revelation revelation/test/
- python -m doctest scripts/diff_trace.py
- python -m doctest scripts/get_instructions_used.py
- mkdir bin
- test "$TRANSLATE" == "true" && PYTHONPATH=${HOME}/pydgin/:${HOME}/pypy:. ${HOME}/pypy/rpython/bin/rpython
--no-pdb --opt=jit revelation/sim.py || true
- mv pydgin-revelation-jit bin/ 2>/dev/null
- test "$TRANSLATE" == "true" && PYTHONPATH=${HOME}/pydgin/:${HOME}/pypy:. ${HOME}/pypy/rpython/bin/rpython
--no-pdb -O2 revelation/sim.py || true
- mv pydgin-revelation-nojit bin/ 2>/dev/null
after_success:
- coveralls
- bash ./scripts/deploy.sh
27 changes: 27 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -e # Exit with non-zero exit code if anything fails.
set -x # Trace everything that the script executes.

if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ `ls ${TRAVIS_BUILD_DIR}/bin/* 2>/dev/null | wc -l` = "2" ]; then
echo -e "Starting to update revelation-bins.\n"

# Configure git.
git config --global user.email "travis-ci@travis-ci.org"
git config --global user.name "Travis CI"

# Clone revelation binaries repository.
cd ${HOME}
git clone --quiet --branch=master https://$GH_TOKEN@github.com/futurecore/revelation-bins.git revelation-bins &2>/dev/null

# Copy binary simulators into new repository.
cd revelation-bins
cp ${TRAVIS_BUILD_DIR}/bin/pydgin-revelation* .

# Add, commit and push binary files.
git add pydgin-revelation*
git commit -m "Travis build ${TRAVIS_BUILD_NUMBER} pushed to master"
git push https://futurecore:$GH_TOKEN@github.com/futurecore/revelation-bins master

echo -e "Finished pushing to revelation-bins.\n"
fi

0 comments on commit 507892b

Please sign in to comment.