-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
78 lines (68 loc) · 2.18 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
language: php
dist: xenial
php:
- 7.0
- 7.1
- 7.2
- 7.3
- nightly
env:
global:
- BITCOIN_VERSION=0.16.3
- DOCKER_CACHE_DIR=/home/travis/docker
cache:
directories:
- ${DOCKER_CACHE_DIR}
matrix:
exclude:
- php: 7.2
env: BITCOIN_VERSION=0.16.3
include:
- php: 7.2
env: BITCOIN_VERSION=0.16.3 COVERAGE=true
- php: 7.2
env: BITCOIN_VERSION=0.17.0
- php: 7.2
env: BITCOIN_VERSION=0.13.2
- php: 7.2
env: BITCOIN_VERSION=0.14.3
- php: 7.2
env: BITCOIN_VERSION=0.15.2
before_install:
- if [ "${COVERAGE}" = "true" ]; then ./travis/docker-load-cache.sh bitcoinconsensusbuild || echo "failed"; fi
install:
- |
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
&& tar xvf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz \
&& cd bitcoin-${BITCOIN_VERSION} \
&& sudo cp include/bitcoinconsensus.h /usr/include/ \
&& sudo cp lib/libbitcoinconsensus.so.0.0.0 /usr/lib/ \
&& sudo ln /usr/lib/libbitcoinconsensus.so.0.0.0 -s /usr/lib/libbitcoinconsensus.so.0 \
&& sudo ln /usr/lib/libbitcoinconsensus.so.0.0.0 -s /usr/lib/libbitcoinconsensus.so \
&& sudo ls -lsah /usr/lib/libbitcoin* \
&& sudo ldconfig \
&& cd ..
- |
cd bitcoinconsensus \
&& phpize && ./configure --with-bitcoinconsensus && make && sudo make install \
&& cd ..
- |
cp bitcoin-${BITCOIN_VERSION}/lib/libbitcoinconsensus.so.0.0.0 tools/phpqa/lib/ && \
cp bitcoin-${BITCOIN_VERSION}/include/bitcoinconsensus.h tools/phpqa/lib/
- git clone https://github.com/jonasnick/bitcoinconsensus_testcases.git
- composer update
before_script:
- php-config || true
- phpenv rehash
- phpenv version-name
- |
if [ "${COVERAGE}" = "true" ]; then \
cd tools/phpqa/ && docker build -t bitcoinconsensusbuild . && cd ../.. && \
./tools/docker-save-cache.sh bitcoinconsensusbuild
fi
script:
- tools/verify_stubs.sh || exit 1
- php -dextension=bitcoinconsensus.so vendor/bin/phpunit --debug tests/
- tools/run_coverage_test.sh || exit 1
after_script:
- bash <(curl -s https://codecov.io/bash)