forked from wizardsardine/liana
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
125 lines (115 loc) · 4.57 KB
/
.cirrus.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
task:
name: 'Functional tests'
container:
image: rust:1-bookworm
timeout_in: 90m # https://cirrus-ci.org/faq/#instance-timed-out
env:
EXECUTOR_WORKERS: 3
VERBOSE: 0
LOG_LEVEL: debug
TIMEOUT: 300
matrix:
- name: 'Misc functional tests'
env:
TEST_GROUP: tests/test_misc.py
matrix:
- USE_MIN_BITCOIN_VERSION: 'TRUE'
- USE_MIN_BITCOIN_VERSION: 'FALSE'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'electrs'
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'electrs'
- name: 'RPC functional tests'
env:
TEST_GROUP: tests/test_rpc.py
matrix:
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'electrs'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'electrs'
- name: 'Chain functional tests'
env:
TEST_GROUP: tests/test_chain.py
matrix:
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'electrs'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'electrs'
- name: 'Spend functional tests'
env:
TEST_GROUP: tests/test_spend.py
matrix:
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'bitcoind'
- USE_TAPROOT: 0
BITCOIN_BACKEND_TYPE: 'electrs'
- USE_TAPROOT: 1
BITCOIN_BACKEND_TYPE: 'electrs'
cargo_registry_cache:
folders: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
cargo_git_cache:
folders: $CARGO_HOME/git # It will fail if they aren't separated
fingerprint_script: cat Cargo.lock
target_cache:
folder: target
fingerprint_script:
- rustc --version
- cat Cargo.lock
tests_tools_cache:
folder: tests/tools/taproot_signer/target
fingerprint_script:
- rustc --version
- cat tests/tools/taproot_signer/Cargo.lock
lianad_build_script: cargo build --release && cd tests/tools/taproot_signer && cargo build --release
deps_script: apt update && apt install -y python3 python3-pip
pip_cache:
folder: ~/.cache/pip
python_deps_script: pip install --break-system-packages -r tests/requirements.txt
test_script: |
set -xe
# We always need bitcoind, even when using a different backend.
if [ "$USE_MIN_BITCOIN_VERSION" = "TRUE" ]; then
# Download the minimum required bitcoind binary
curl -O https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
echo "49df6e444515d457ea0b885d66f521f2a26ca92ccf73d5296082e633544253bf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz" | sha256sum -c
tar -xzf bitcoin-24.0.1-x86_64-linux-gnu.tar.gz
export BITCOIND_PATH=bitcoin-24.0.1/bin/bitcoind
export IS_NOT_BITCOIND_24=0
else
# Download the bitcoind binary
curl -O https://bitcoincore.org/bin/bitcoin-core-26.0/bitcoin-26.0-x86_64-linux-gnu.tar.gz
echo "23e5ab226d9e01ffaadef5ffabe8868d0db23db952b90b0593652993680bb8ab bitcoin-26.0-x86_64-linux-gnu.tar.gz" | sha256sum -c
tar -xzf bitcoin-26.0-x86_64-linux-gnu.tar.gz
export BITCOIND_PATH=bitcoin-26.0/bin/bitcoind
fi
if [ "$BITCOIN_BACKEND_TYPE" = "electrs" ]; then
curl -OL https://github.com/RCasatta/electrsd/releases/download/electrs_releases/electrs_linux_v0.9.11.zip
echo "2b2f8aef35cd8e16e109b948a903d010aa472f6cdf2147d47e01fd95cd1785da electrs_linux_v0.9.11.zip" | sha256sum -c
unzip electrs_linux_v0.9.11.zip
chmod 754 electrs
export ELECTRS_PATH=$PWD/electrs
fi
# The misc tests have a backward compat test that need the path to a previous version of Liana.
# For now it requires using 0.3.
if [ "$TEST_GROUP" = "tests/test_misc.py" ]; then
curl -LO https://github.com/wizardsardine/liana/releases/download/0.3.1/liana-0.3.1-x86_64-linux-gnu.tar.gz
echo "70c8595554b6f78ccc7b66ef5f5ebc5bac03a7b1ce28afe8a076f69adf59c583 liana-0.3.1-x86_64-linux-gnu.tar.gz" | sha256sum -c
tar -xzf liana-0.3.1-x86_64-linux-gnu.tar.gz
export OLD_LIANAD_PATH="$PWD/liana-0.3.1-x86_64-linux-gnu/lianad"
fi
# Run the functional tests
LIANAD_PATH=$PWD/target/release/lianad pytest $TEST_GROUP -vvv -n 2
before_cache_script: rm -rf $CARGO_HOME/registry/index