Repository navigation
222 lines (189 loc) · 5.59 KB
/
Copy pathmain.yml
File metadata and controls
222 lines (189 loc) · 5.59 KB
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
name: Build and Test
on: [push, pull_request]
env:
# go needs absolute directories, using the $HOME variable doesn't work here.
GOCACHE: /home/runner/work/go/pkg/build
GOPATH: /home/runner/work/go
GOBIN: /home/runner/work/go/bin
GO_VERSION: 1.27.3
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out source
uses: actions/checkout@v7
- name: Build
run: make build
- name: Cross-compile (android/arm64)
env:
GOOS: android
GOARCH: arm64
run: |
go build ./...
(cd btcutil && go build ./...)
test-cover:
name: Unit coverage
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out source
uses: actions/checkout@v7
- name: Test
run: make unit-cover
- name: Send top-level coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: coverage.txt
flag-name: btcd
format: 'golang'
parallel: true
- name: Send address coverage
uses: coverallsapp/github-action@v2
with:
file: address/coverage.txt
flag-name: address
format: 'golang'
parallel: true
- name: Send btcec coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: btcec/coverage.txt
flag-name: btcec
format: 'golang'
parallel: true
- name: Send chaincfg coverage
uses: coverallsapp/github-action@v2
with:
file: chaincfg/coverage.txt
flag-name: chaincfg
format: 'golang'
parallel: true
- name: Send chainhash coverage
uses: coverallsapp/github-action@v2
with:
file: chainhash/coverage.txt
flag-name: chainhash
format: 'golang'
parallel: true
- name: Send btcutil coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: btcutil/coverage.txt
flag-name: btcutil
format: 'golang'
parallel: true
- name: Send psbt coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: psbt/coverage.txt
flag-name: psbt
format: 'golang'
parallel: true
- name: Send txscript coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: txscript/coverage.txt
flag-name: txscript
format: 'golang'
parallel: true
- name: Send wire coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: wire/coverage.txt
flag-name: wire
format: 'golang'
parallel: true
- name: Send v2transport coverage
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: v2transport/coverage.txt
flag-name: v2transport
format: 'golang'
parallel: true
- name: Notify coveralls all reports sent
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
parallel-finished: true
test-race:
name: Unit race
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out source
uses: actions/checkout@v7
- name: Test
run: make unit-race
test-rpctest:
name: Unit rpctest
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out source
uses: actions/checkout@v7
- name: Test
run: make unit
# Builds and tests with the minimum Go version from go.mod, so code that
# needs a newer Go than go.mod promises fails here (see the Go version policy
# in README.md).
test-min-go:
name: Minimum Go version
runs-on: ubuntu-latest
env:
# Fail rather than switch to a newer Go if a go.mod asks for one.
GOTOOLCHAIN: local
steps:
- name: Check out source
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Build
run: make build
- name: Test
run: make unit
# The go.mod files require the published versions of the other modules in
# this repo. This job builds and tests all modules against each other's
# in-tree code instead, so a change to a sub-module is checked against the
# code that uses it before the sub-module is tagged.
test-workspace:
name: In-tree modules
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out source
uses: actions/checkout@v7
- name: Create workspace
run: |
find . -mindepth 2 -name go.mod -printf '%h\n' | sort |
xargs go work init .
# Even in a workspace, ./... from the root doesn't reach the nested
# modules. make unit tests each module from its own directory, which
# also builds all of their packages.
- name: Test
run: make unit