-
Notifications
You must be signed in to change notification settings - Fork 19
160 lines (145 loc) · 4.27 KB
/
test.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Tests
on:
push:
branches: [ main ]
paths-ignore:
- 'diagrams/**'
- 'docs/**'
- '.*'
- '**.md'
- '*.nix'
- '*.yml'
- '*.json'
- 'LICENSE'
pull_request:
branches: [ main ]
paths-ignore:
- 'diagrams/**'
- 'docs/**'
- '.*'
- '**.md'
- '*.nix'
- '*.yml'
- '*.json'
- 'LICENSE'
env:
CARGO_TERM_COLOR: always
RUST_LOG_STYLE: always
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get install -y cmake
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Rust cache
uses: Swatinem/[email protected]
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-targets --all-features --no-fail-fast
functional-test:
name: Functional tests
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
test: [
bitcoin_syncer,
monero_syncer,
swap_alice_maker,
swap_bob_funds_incorrect_amount,
swap_bob_maker_kill_peerd,
swap_bob_maker_manual_monero_sweep,
swap_bob_maker_manual_bitcoin_sweep,
swap_bob_maker_normal,
swap_bob_maker_punish_kill_bob,
swap_bob_maker_refund,
swap_bob_maker_restore_checkpoint,
swap_bob_maker_restore_reconnect_alice_pre_lock,
swap_bob_maker_user_abort_sweep_btc,
swap_parallel_execution,
swap_revoke_deal_bob_maker_normal,
cli,
grpc,
]
bitcoin: [ '23.0' ]
electrs: [ 0.9.9 ]
include:
- test: bitcoin_syncer
bitcoin: '22.0'
electrs: 0.8.11
- test: bitcoin_syncer
bitcoin: '22.0'
electrs: 0.9.9
runs-on: ubuntu-latest
env:
RUST_LOG: 'info,farcaster_node=debug,microservices=debug'
RUST_BACKTRACE: 1
container:
image: rust:slim-bullseye
volumes:
- bitcoind-data:/data
services:
bitcoind:
image: ghcr.io/farcaster-project/containers/bitcoin-core:${{ matrix.bitcoin }}
env:
NETWORK: regtest
RPC_PORT: 18443
FALLBACKFEE: '0.00001'
volumes:
- bitcoind-data:/data
electrs:
image: ghcr.io/farcaster-project/containers/electrs:${{ matrix.electrs }}
env:
NETWORK: regtest
DAEMON_RPC_ADDR: bitcoind:18443
DAEMON_P2P_ADDR: bitcoind:18444
ELECTRUM_RPC_PORT: 60401
volumes:
- bitcoind-data:/data
monerod:
image: ghcr.io/farcaster-project/containers/monerod:0.18.1.2
env:
NETWORK: regtest
OFFLINE: --offline
DIFFICULTY: 1
monero-wallet-rpc-1:
image: ghcr.io/farcaster-project/containers/monero-wallet-rpc:0.18.1.2
env:
MONERO_DAEMON_ADDRESS: monerod:18081
WALLET_RPC_PORT: 18083
monero-wallet-rpc-2:
image: ghcr.io/farcaster-project/containers/monero-wallet-rpc:0.18.1.2
env:
MONERO_DAEMON_ADDRESS: monerod:18081
WALLET_RPC_PORT: 18083
monero-wallet-rpc-3:
image: ghcr.io/farcaster-project/containers/monero-wallet-rpc:0.18.1.2
env:
MONERO_DAEMON_ADDRESS: monerod:18081
WALLET_RPC_PORT: 18083
monero-lws:
image: ghcr.io/farcaster-project/containers/monero-lws:monerod-0.18.1.2
env:
NETWORK: main
MONERO_DAEMON_ADDRESS: monerod:18082
steps:
- uses: actions/checkout@v3
- name: Refresh cache and add apt-utils
run: apt-get update -y && apt-get install -y --no-install-recommends apt-utils
- name: Install dependencies
run: DEBIAN_FRONTEND=noninteractive apt-get install -y libssl-dev pkg-config build-essential cmake
- name: Rust cache
uses: Swatinem/[email protected]
with:
key: ${{ matrix.test }}
- name: Cargo functional test
run: cargo test ${{ matrix.test }} --workspace --all-targets --all-features --color always -- --ignored --test-threads=1