-
Notifications
You must be signed in to change notification settings - Fork 1
359 lines (306 loc) · 9.48 KB
/
ci.yaml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
name: Continuous Integration
on:
push:
branches:
- "main"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
fmt-check:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install virtualenv
run: python -m pip install --user virtualenv
- name: Run Format check
run: make fmt-check
itest-grpc-check:
name: itest grpc check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install virtualenv
run: python -m pip install --user virtualenv
- name: Generate grpc bindings
run: |
make itest-gen-proto
make fmt-python
- name: Check git status
env:
GIT_PAGER: cat
run: |
status=$(git status --porcelain)
if [[ -n "$status" ]]; then
echo "Git status has changes"
echo "$status"
git diff
exit 1
else
echo "No changes in git status"
fi
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install Protoc
if: steps.cache.outputs.cache-hit != 'true'
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: clippy
run: make clippy
compile-cln:
runs-on: ubuntu-latest
strategy:
matrix:
cln:
- version: v24.11rc4
rust-version: stable
org: ElementsProject
repo: lightning
- version: v24.08
rust-version: stable
org: ElementsProject
repo: lightning
- version: v24.05
rust-version: 1.79.0
org: ElementsProject
repo: lightning
- version: v24.02.2
rust-version: 1.79.0
org: ElementsProject
repo: lightning
- version: v23.11.2
rust-version: 1.79.0
org: ElementsProject
repo: lightning
steps:
- name: Cache CLN
id: cache
uses: actions/cache@v4
with:
path: inst
key: ${{ runner.os }}-${{ runner.arch }}-cln-${{ matrix.cln.version}}
- name: Checkout
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: ${{ matrix.cln.org }}/${{ matrix.cln.repo }}
ref: ${{ matrix.cln.version }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y libffi-dev zlib1g-dev libsodium-dev gettext
- name: Set up Python 3.8
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install rust
if: steps.cache.outputs.cache-hit != 'true'
run: |
rustup set auto-self-update disable
rustup install ${{ matrix.cln.rust-version }}
rustup default ${{ matrix.cln.rust-version }}
- name: Install Protoc
if: steps.cache.outputs.cache-hit != 'true'
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
if: steps.cache.outputs.cache-hit != 'true'
run: |
set -e
pip3 install --user pip wheel poetry
poetry export -o requirements.txt --with dev --without-hashes
python3 -m pip install -r requirements.txt
./configure --enable-rust
make -j $(nproc)
mkdir inst
make install DESTDIR=inst/
- uses: actions/upload-artifact@v4
name: Upload cln artifact
with:
name: ${{ runner.os }}-${{ runner.arch }}-cln-${{ matrix.cln.version}}
path: inst
compile-lnd:
runs-on: ubuntu-latest
strategy:
matrix:
lnd:
- version: jssdwt-v0.18.3-with-ca
org: breez
repo: lnd
go-version: 1.21.4
steps:
- name: Cache lnd
id: cache
uses: actions/cache@v4
with:
path: inst
key: ${{ runner.os }}-${{ runner.arch }}-lnd-${{ matrix.lnd.version}}
- name: Checkout
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: ${{ matrix.lnd.org }}/${{ matrix.lnd.repo }}
ref: ${{ matrix.lnd.version }}
- name: Setup go ${{ matrix.lnd.go-version }}
uses: actions/setup-go@v5
with:
go-version: '${{ matrix.lnd.go-version }}'
- name: Compile lnd
if: steps.cache.outputs.cache-hit != 'true'
env:
GOPATH: /opt/lnd
run: make release-install
- uses: actions/upload-artifact@v4
name: Upload lnd artifact
with:
name: ${{ runner.os }}-${{ runner.arch }}-lnd-${{ matrix.lnd.version}}
path: /opt/lnd/bin/lnd
itest-cln:
name: Integration tests (cln)
needs: compile-cln
runs-on: ubuntu-latest
strategy:
matrix:
cln-version:
- v24.11rc4
- v24.08
- v24.05
- v24.02.2
- v23.11.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Install bitcoind
run: |
wget -q "https://bitcoincore.org/bin/bitcoin-core-26.1/bitcoin-26.1-x86_64-linux-gnu.tar.gz"
tar -xzf "bitcoin-26.1-x86_64-linux-gnu.tar.gz"
sudo cp -r "bitcoin-26.1/bin" "/usr/local"
rm -rf "bitcoin-26.1-x86_64-linux-gnu.tar.gz" "bitcoin-26.1"
- name: Download cln artifact
uses: actions/download-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-cln-${{ matrix.cln-version}}
path: inst
- name: Install CLN
run: |
chmod +x -R inst/
sudo cp -a inst/usr/local/. /usr/local/
- name: Install virtualenv
run: python -m pip install --user virtualenv
- name: Integration tests
env:
TEST_DEBUG: 1
SLOW_MACHINE: 1
PYTEST_PAR: 5
run: make itest-cln
itest-lnd:
name: Integration tests (lnd)
needs:
- compile-cln
- compile-lnd
runs-on: ubuntu-latest
strategy:
matrix:
test:
- lnd-version: jssdwt-v0.18.3-with-ca
cln-version: v24.08
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Install bitcoind
run: |
wget -q "https://bitcoincore.org/bin/bitcoin-core-26.1/bitcoin-26.1-x86_64-linux-gnu.tar.gz"
tar -xzf "bitcoin-26.1-x86_64-linux-gnu.tar.gz"
sudo cp -r "bitcoin-26.1/bin" "/usr/local"
rm -rf "bitcoin-26.1-x86_64-linux-gnu.tar.gz" "bitcoin-26.1"
- name: Download lnd artifact
uses: actions/download-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-lnd-${{ matrix.test.lnd-version}}
path: lnd-artifact
- name: Install lnd
run: |
chmod +x -R lnd-artifact/
sudo cp lnd-artifact/lnd /usr/local/bin
- name: Download cln artifact
uses: actions/download-artifact@v4
with:
name: ${{ runner.os }}-${{ runner.arch }}-cln-${{ matrix.test.cln-version}}
path: inst
- name: Install CLN
run: |
chmod +x -R inst/
sudo cp -a inst/usr/local/. /usr/local/
- name: Install virtualenv
run: python -m pip install --user virtualenv
- name: Integration tests
env:
TEST_DEBUG: 1
SLOW_MACHINE: 1
PYTEST_PAR: 5
run: make itest-lnd
utest:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust
run: |
rustup set auto-self-update disable
rustup toolchain install stable --profile minimal
- name: Install Protoc
if: steps.cache.outputs.cache-hit != 'true'
uses: arduino/setup-protoc@v3
with:
version: "27.4"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Unit tests
run: make utest