forked from lightninglabs/taproot-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
351 lines (285 loc) · 8.13 KB
/
main.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
name: CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
merge_group:
branches:
- 'main'
defaults:
run:
shell: bash
env:
# go needs absolute directories, using the $HOME variable doesn't work here.
GOPATH: /home/runner/work/go
GO_VERSION: '1.22.6'
LITD_ITEST_BRANCH: 'update-to-lnd-18-4'
jobs:
#######################
# sql model generation
#######################
sqlc-check:
name: Sqlc check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: docker image cache
uses: jpribyl/[email protected]
continue-on-error: true
- name: Generate sql models
run: make sqlc-check
rpc-check:
name: RPC check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: Generate RPC stubs and check REST annotations
run: make rpc-check
mod-check:
name: go mod check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: Run go mod tidy
run: make mod-check
test-vector-check:
name: test vector check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: Run test vector creation check
run: make test-vector-check
migration-check:
name: migration version check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Run migration check
run: make migration-check
########################
# Compilation check.
########################
compile-check:
name: Compilation check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: compile code
run: go install -v ./...
- name: Compile docs examples
run: make build-docs-examples
########################
# sample configuration check
########################
sample-conf-check:
name: sample configuration check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: setup go environment
uses: ./.github/actions/setup-go
- name: check default values in sample-tapd.conf file
run: make sample-conf-check
########################
# Docker build check.
########################
docker-build-check:
name: Docker build check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build default image
uses: docker/build-push-action@v4
with:
tags: 'default-taproot-assets'
- name: Build dev image
uses: docker/build-push-action@v4
with:
file: dev.Dockerfile
tags: 'dev-taproot-assets'
########################
# cross compilation
########################
cross-compile:
name: cross compilation
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
- name: build release for all architectures
run: make release
########################
# Lint check.
########################
lint-check:
name: Lint check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: run lint
run: make lint
########################
# Format check.
########################
format-check:
name: Format check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: run format
run: make fmt
########################
# run unit tests
########################
unit-test:
name: run unit tests
runs-on: ubuntu-latest
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
matrix:
unit_type:
- unit-race
- unit-cover
- unit dbbackend=postgres
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: run ${{ matrix.unit_type }}
run: make ${{ matrix.unit_type }}
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
if: matrix.unit_type == 'unit-cover'
with:
path-to-profile: coverage.txt
flag-name: 'unit'
parallel: true
########################
# run integration tests
########################
integration-test:
name: run itests
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: run itest
run: make itest
- name: Zip log files on failure
if: ${{ failure() }}
run: 7z a logs-itest.zip itest/**/*.log
- name: Upload log files on failure
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: logs-itest
path: logs-itest.zip
retention-days: 5
########################
# run integration tests with Postgres backend
########################
integration-test-postgres:
name: run itests postgres
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: run itest
run: make itest dbbackend=postgres
- name: Zip log files on failure
if: ${{ failure() }}
run: 7z a logs-itest-postgres.zip itest/**/*.log
- name: Upload log files on failure
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: logs-itest-postgres
path: logs-itest-postgres.zip
retention-days: 5
########################
# Run LiTd tests
########################
run-lit-tests:
name: run LiT tests
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Setup go environment
uses: ./.github/actions/setup-go
- name: Clone Lit repository
uses: actions/checkout@v3
with:
repository: lightninglabs/lightning-terminal
ref: ${{ env.LITD_ITEST_BRANCH }}
path: lightning-terminal
- name: Update go.mod to use the local Tap repository
working-directory: ./lightning-terminal
run: |
go mod edit -replace=github.com/lightninglabs/taproot-assets=../
go mod tidy
- name: Install yarn
run: npm install -g yarn
- name: setup nodejs
uses: ./lightning-terminal/.github/actions/setup-node
with:
node-version: 16.x
- name: install LiT app dependencies
working-directory: ./lightning-terminal/app
run: yarn
- name: Run LiT itests
working-directory: ./lightning-terminal
run: make itest icase=custom_channels
- name: Run LiT unit tests
working-directory: ./lightning-terminal
run: make unit
# Notify about the completion of all coverage collecting jobs.
finish:
if: ${{ always() }}
needs: [unit-test]
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true