Created
October 20, 2018 18:27
-
-
Save akshaynexus/4e1661416ae6793ab1c7700305eb57f1 to your computer and use it in GitHub Desktop.
sample travis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: required | |
dist: trusty | |
group: deprecated-2017Q3 | |
os: linux | |
language: generic | |
cache: | |
apt: true | |
ccache: true | |
directories: | |
- depends/built | |
- depends/sdk-sources | |
- "$HOME/.ccache" | |
addons: | |
env: | |
global: | |
- MAKEJOBS=-j5 | |
- RUN_TESTS=false | |
- BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID | |
- CCACHE_SIZE=400M | |
- CCACHE_TEMPDIR=/tmp/.ccache-temp | |
- CCACHE_COMPRESS=1 | |
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out | |
- SDK_URL=https://bitcoincore.org/depends-sources/sdks | |
- PYTHON_DEBUG=1 | |
- WINEDEBUG=fixme-all | |
matrix: | |
- HOST=arm-linux-gnueabihf PPA="ppa:bitcoin/bitcoin" PACKAGES="g++-arm-linux-gnueabihf" | |
DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" DOGECASH_CONFIG="--enable-glibc-back-compat | |
--enable-reduce-exports" | |
- HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" PPA="ppa:bitcoin/bitcoin" | |
PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.7 bc" GOAL="install" DOGECASH_CONFIG="--enable-gui | |
--enable-reduce-exports" MAKEJOBS="-j4" WINE=true GOAL="deploy" | |
- HOST=i686-pc-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="g++-multilib bc python3-zmq" DEP_OPTS="NO_UPNP=1 DEBUG=0" | |
GOAL="install" DOGECASH_CONFIG="--enable-gui --enable-zmq --enable-glibc-back-compat GOAL="deploy" | |
--enable-reduce-exports LDFLAGS=-static-libstdc++" PYZMQ=true | |
- HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" PPA="ppa:bitcoin/bitcoin" | |
PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine1.7 bc" GOAL="install" DOGECASH_CONFIG="--enable-gui | |
--enable-reduce-exports" MAKEJOBS="-j4" WINE=true GOAL="deploy" | |
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="bc python3-zmq" | |
DEP_OPTS="NO_UPNP=1 DEBUG=0" GOAL="install" DOGECASH_CONFIG="--enable-gui --enable-zmq | |
--enable-glibc-back-compat --enable-reduce-exports" PYZMQ=true | |
- HOST=x86_64-apple-darwin11 PPA="ppa:bitcoin/bitcoin" PACKAGES="cmake imagemagick | |
libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" DEV_OPTS="NO_QT=1" | |
DOGECASH_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 | |
before_install: | |
- openssl aes-256-cbc -K $encrypted_3f8326effd40_key -iv $encrypted_3f8326effd40_iv | |
-in deploy_rsa.enc -out deploy_rsa -d | |
- travis_retry sudo apt-get install python-dev | |
- travis_retry sudo add-apt-repository ppa:ubuntu-wine/ppa -y | |
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | | |
sed "s|::|:|g") | |
install: | |
- if [ "$PYZMQ" = "true" ]; then pip install pyzmq --user ; fi | |
- if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi | |
- if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; | |
fi | |
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi | |
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends | |
--no-upgrade -qq $PACKAGES; fi | |
- cd x16r_hash && python setup.py install --user && cd .. | |
before_script: | |
- unset CC; unset CXX | |
- unset DISPLAY | |
- mkdir -p depends/SDKs depends/sdk-sources | |
- if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then | |
curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; | |
fi | |
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then | |
tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi | |
- make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS | |
script: | |
- if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi | |
- OUTDIR=$BASE_OUTDIR/$TRAVIS_JOB_NUMBER-$HOST | |
- DOGECASH_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST | |
--bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" | |
- depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE | |
- test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh | |
- "./configure --cache-file=config.cache $DOGECASH_CONFIG_ALL $DOGECASH_CONFIG || ( cat | |
config.log && false)" | |
- make distdir PACKAGE=dogecash VERSION=$HOST | |
- cd dogecash-$HOST | |
- "./configure --cache-file=../config.cache $DOGECASH_CONFIG_ALL $DOGECASH_CONFIG || ( | |
cat config.log && false)" | |
- make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL | |
V=1 ; false ) | |
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib | |
- if [ "$RUN_TESTS" = "true" -a "$WINE" != "true" ]; then travis_wait 30 make $MAKEJOBS | |
check VERBOSE=1; fi | |
- if [ "$RUN_TESTS" = "true" -a "$WINE" = "true" ]; then wine src/test/test_motion.exe | |
--log_level=test_suite; fi | |
- if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.py --coverage; fi | |
after_script: | |
- ls $TRAVIS_BUILD_DIR | |
- ls $BASE_OUTDIR | |
- ls $TRAVIS_BUILD_DIR | |
- zip -r $TRAVIS_BUILD_DIR-dogecash-$HOST.zip $TRAVIS_BUILD_DIR/dogecash-$HOST | |
- transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } | |
-cat <<EOT >> discordmessenger.py | |
-# system library for getting the command line argument | |
-import sys | |
-# web library | |
-import http.client | |
-def send( message ): | |
-# your webhook URL | |
-webhookurl = "https://discordapp.com/api/webhooks/489694485454913547/ap9PI9SU5S986cUGU3KNcvhHeSDVn7nQZ_wRuHpLaDwA54VM-k-TYijVxERo9AjXqUH-" | |
-# compile the form data (BOUNDARY can be anything) | |
-formdata = "------:::BOUNDARY:::\r\nContent-Disposition: form-data; name=\"content\"\r\n\r\n" + message + "\r\n------:::BOUNDARY:::--" | |
-# get the connection and make the request | |
-connection = http.client.HTTPSConnection("discordapp.com") | |
- connection.request("POST", webhookurl, formdata, { | |
-'content-type': "multipart/form-data; boundary=----:::BOUNDARY:::", | |
-'cache-control': "no-cache", | |
-}) | |
-# get the response | |
-response = connection.getresponse() | |
-result = response.read() | |
-# return back to the calling function with the result | |
-return result.decode("utf-8") | |
-# send the messsage and print the response | |
-print( send( sys.argv[1] ) ) | |
-EOT | |
-LINKTOZIP=$(transfer $TRAVIS_BUILD_DIR-dogecash-$HOST.zip) | |
-python3 discordmessenger.py link to build for $HOST is | |
-python3 discordmessenger.py $LINKTOZIP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment