forked from Bit-Wasp/bitcoin-php
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
103 lines (91 loc) · 3.94 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
language: php
php:
- hhvm
- 5.6
- 7.0
- 7.1
- 7.2
env:
- PHPUNIT=true PHPUNIT_EXT=true BITCOIN_VERSION="0.15.0"
dist: trusty
sudo: required
cache:
directories:
${HOME}/bitcoin
matrix:
exclude:
- php: hhvm
env: PHPUNIT=true PHPUNIT_EXT=true BITCOIN_VERSION="0.15.0"
include:
# hhvm with normal tests (no extension tests)
- php: hhvm
env: PHPUNIT=true
# 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
- php: 7.0
env: 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.2 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" ]; then phpenv config-rm xdebug.ini && echo "xdebug disabled"; fi
script:
- if [ "$PHPUNIT" = "true" ]; then make phpunit-ci; fi
- if [ "$PHPUNIT_EXT" = "true" ]; then EXT_PHP=" -dextension=secp256k1.so " make phpunit-ci; fi
- if [ "$PHPUNIT_EXT" = "true" ]; then EXT_PHP=" -dextension=bitcoinconsensus.so " make phpunit-ci; fi
- if [ "$PHPUNIT_EXT" = "true" ]; then EXT_PHP=" -dextension=bitcoinconsensus.so -dextension=secp256k1.so " make phpunit-ci; fi
- if [ "$CODE_STYLE" = "true" ]; then make phpcs && echo "Code style OK"; fi
- if [ "$EXAMPLES" = "true" ]; then make test-examples && echo "Examples OK"; fi
- if [ "$RPC_TEST" = "true" ]; then export BITCOIND_PATH="$HOME/bitcoin/bitcoin-$BITCOIN_VERSION/bin/bitcoind"; fi
- if [ "$RPC_TEST" = "true" ]; then vendor/bin/phpunit --debug -c phpunit.rpc.xml; fi
after_script:
- if [ "${COVERAGE}" = "true" ]; then make scrutinizer; fi