forked from Bit-Wasp/bitcoin-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
89 lines (79 loc) · 3.31 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
language: php
php:
- 7.0
- 7.1
- 7.2
- nightly
env:
- PHPUNIT=true PHPUNIT_EXT=true BITCOIN_VERSION="0.15.0"
dist: trusty
sudo: required
cache:
directories:
${HOME}/bitcoin
matrix:
include:
# add extra test runs for php7: coverage, codestyle, examples, rpc tests
- php: 7.0
env: PHPUNIT=true BITCOIN_VERSION="0.15.0" PHPUNIT_EXT=true COVERAGE=true CODE_STYLE=true EXAMPLES=true
- php: 7.0
env: RPC_TEST=true BITCOIN_VERSION="0.15.0"
install:
- |
if [ "$BITCOIN_VERSION" != "" ] && [ ! -e "${HOME}/bitcoin" ]; then
mkdir ${HOME}/bitcoin
fi
- |
if [ "$BITCOIN_VERSION" != "" ] && [ ! -e "${HOME}/bitcoin/bitcoin-$BITCOIN_VERSION" ]; then
cd ${HOME}/bitcoin &&
rm bitcoin-* -rf &&
wget https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz &&
mv bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz bitcoin.tar.gz &&
tar xvf bitcoin.tar.gz &&
cd ${TRAVIS_BUILD_DIR}
else
echo "Had bitcoind"
fi
- |
if [ "$PHPUNIT_EXT" = "true" ]; then
git clone https://github.com/bitcoin/secp256k1.git &&
cd secp256k1 &&
./autogen.sh && ./configure --disable-jni --enable-module-recovery --enable-module-ecdh --enable-experimental &&
make && sudo make install && cd ..;
fi
- |
if [ "$PHPUNIT_EXT" = "true" ] && [ "$TRAVIS_PHP_VERSION" = "5.6" ]; then
git clone -b v0.0 https://github.com/Bit-Wasp/secp256k1-php &&
cd secp256k1-php/secp256k1 &&
phpize && ./configure &&
make && sudo make install && cd ../..;
fi
- |
if [ "$PHPUNIT_EXT" = "true" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then
git clone -b v0.1.3 https://github.com/Bit-Wasp/secp256k1-php &&
cd secp256k1-php/secp256k1 &&
phpize && ./configure &&
make && sudo make install && cd ../..;
fi
- |
if [ "$PHPUNIT_EXT" = "true" ]; then
sudo cp ${HOME}/bitcoin/bitcoin-${BITCOIN_VERSION}/include/bitcoinconsensus.h /usr/include &&
sudo cp ${HOME}/bitcoin/bitcoin-${BITCOIN_VERSION}/lib/libbitcoinconsensus.so.0.0.0 /usr/lib &&
sudo ln -s /usr/lib/libbitcoinconsensus.so.0.0.0 /usr/lib/libbitcoinconsensus.so &&
sudo ln -s /usr/lib/libbitcoinconsensus.so.0.0.0 /usr/lib/libbitcoinconsensus.so.0 &&
git clone -b v2.0.0 https://github.com/Bit-Wasp/bitcoinconsensus-php &&
cd bitcoinconsensus-php/bitcoinconsensus &&
phpize && ./configure --with-bitcoinconsensus &&
make && sudo make install && cd ../..;
fi
- composer update
before_script:
- if [ "${COVERAGE}" != "true" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then phpenv config-rm xdebug.ini && echo "xdebug disabled"; fi
script:
- travis/run_secp256k1_tests.sh || exit 1
- travis/run_phpunit_tests.sh || exit 1
- travis/run_rpc_tests.sh || exit 1
- if [ "$CODE_STYLE" = "true" ]; then make phpcs && echo "Code style OK"; fi
- if [ "$EXAMPLES" = "true" ]; then make test-examples && echo "Examples OK"; fi
after_script:
- if [ "${COVERAGE}" = "true" ]; then make scrutinizer; fi