-
Notifications
You must be signed in to change notification settings - Fork 421
/
.travis.yml
88 lines (77 loc) · 3.68 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
language: php
php:
- 7.0
- 7.1
- 7.2
- 7.3
env:
- PHPUNIT=true PHPUNIT_EXT=true BITCOIN_VERSION="0.16.3" SECP256K1_COMMIT="cd329dbc3eaf096ae007e807b86b6f5947621ee3"
dist: trusty
sudo: required
cache:
directories:
${HOME}/bitcoin
matrix:
exclude:
- php: 7.2
env: PHPUNIT=true PHPUNIT_EXT=true BITCOIN_VERSION="0.16.3" SECP256K1_COMMIT="cd329dbc3eaf096ae007e807b86b6f5947621ee3"
include:
# add extra test runs for php7: coverage, codestyle, examples, rpc tests
- php: 7.2
env: COVERAGE=true CODE_STYLE=true EXAMPLES=true PHPUNIT=true PHPUNIT_EXT=true BITCOIN_VERSION="0.16.3" SECP256K1_COMMIT="cd329dbc3eaf096ae007e807b86b6f5947621ee3"
- php: 7.0
env: RPC_TEST=true BITCOIN_VERSION="0.16.3" SECP256K1_COMMIT="cd329dbc3eaf096ae007e807b86b6f5947621ee3"
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 && git checkout ${SECP256K1_COMMIT} &&
./autogen.sh && ./configure --disable-jni --enable-module-recovery --enable-module-ecdh --enable-experimental &&
make && sudo make install && cd ..;
fi
- |
if [ "$PHPUNIT_EXT" = "true" ]; then
git clone -b v0.2.0 https://github.com/Bit-Wasp/secp256k1-php &&
cd secp256k1-php/secp256k1 &&
phpize && ./configure &&
make && sudo make install && echo "extension=secp256k1.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini && 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 v3.0.0 https://github.com/Bit-Wasp/bitcoinconsensus-php &&
cd bitcoinconsensus-php/bitcoinconsensus &&
phpize && ./configure --with-bitcoinconsensus &&
make && sudo make install && echo "extension=bitcoinconsensus.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini && cd ../..;
fi
- composer update
- if [ "${COVERAGE}" = "true" ]; then composer require --dev phpstan/phpstan; fi
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
- if [ "$COVERAGE" = "true" ]; then pwd && vendor/bin/phpstan analyse src tests -l 1; fi
- make phpunit-ci || 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