-
Notifications
You must be signed in to change notification settings - Fork 106
289 lines (235 loc) · 10 KB
/
Copy pathbuild.yml
File metadata and controls
289 lines (235 loc) · 10 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
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
name: PR Checks
defaults:
run:
shell: bash
permissions:
contents: read
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
GO_VERSION: "1.25.7"
NODE_VERSION: "22"
HIERO_VERSION: v0.73.0
MIRROR_NODE_VERSION: v0.153.0
SOLO_VERSION: v0.69.0
HEDERA_NETWORK: localhost
jobs:
build:
name: Build
runs-on: hiero-client-sdk-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Tidy SDK Modules
run: go mod tidy
working-directory: ./
- name: Lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
skip-cache: true
args: --timeout=5m
- name: Build SDK and Examples
run: go build -v ./...
test:
name: Unit and Integration Tests
if: success()
runs-on: hiero-client-sdk-linux-medium
needs:
- build
strategy:
matrix:
test-type: [unit, e2e]
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Prepare Hiero Solo
if: success() && matrix.test-type == 'e2e'
id: solo
uses: hiero-ledger/hiero-solo-action@328bc84c3b00a990a151418144fd682a4eb76ea6 # v0.19.0
with:
installMirrorNode: true
hieroVersion: ${{ env.HIERO_VERSION }}
mirrorNodeVersion: ${{ env.MIRROR_NODE_VERSION }}
soloVersion: ${{ env.SOLO_VERSION }}
- name: Set Operator Account
if: success() && matrix.test-type == 'e2e'
run: |
echo "OPERATOR_KEY=${{ steps.solo.outputs.ed25519PrivateKey }}" >> $GITHUB_ENV
echo "OPERATOR_ID=${{ steps.solo.outputs.ed25519AccountId }}" >> $GITHUB_ENV
- name: Tests Unit
if: success() && matrix.test-type == 'unit'
run: go test ./sdk -tags="unit" -timeout 9999s -v -coverprofile=unit.out -covermode=atomic -race
- name: Tests Integration
if: success() && matrix.test-type == 'e2e'
run: go test ./sdk -tags="e2e" -timeout 9999s -v -coverprofile=e2e.out -covermode=atomic -race
- name: Upload unit test coverage to Codecov
if: success() && matrix.test-type == 'unit'
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit.out
- name: Upload e2e test coverage to Codecov
if: success() && matrix.test-type == 'e2e'
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./e2e.out
test-dab:
name: DAB Tests
if: success()
runs-on: hiero-client-sdk-linux-medium
needs:
- build
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Prepare Hiero Solo
id: solo
uses: hiero-ledger/hiero-solo-action@328bc84c3b00a990a151418144fd682a4eb76ea6 # v0.19.0
with:
installMirrorNode: true
hieroVersion: ${{ env.HIERO_VERSION }}
mirrorNodeVersion: ${{ env.MIRROR_NODE_VERSION }}
soloVersion: ${{ env.SOLO_VERSION }}
dualMode: true
- name: Set Operator Account
run: |
echo "OPERATOR_KEY=${{ steps.solo.outputs.ed25519PrivateKey }}" >> $GITHUB_ENV
echo "OPERATOR_ID=${{ steps.solo.outputs.ed25519AccountId }}" >> $GITHUB_ENV
- name: Tests DAB
run: go test ./sdk -tags="dab" -timeout 9999s -v -coverprofile=dab.out -covermode=atomic -race
- name: Upload dab test coverage to Codecov
if: success()
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./dab.out
run-examples:
name: Run Examples
if: success()
runs-on: hiero-client-sdk-linux-medium
needs:
- build
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Setup NodeJS
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@v3.17.0
- name: Prepare Hiero Solo
id: solo
uses: hiero-ledger/hiero-solo-action@328bc84c3b00a990a151418144fd682a4eb76ea6 # v0.19.0
with:
installMirrorNode: true
hieroVersion: ${{ env.HIERO_VERSION }}
mirrorNodeVersion: ${{ env.MIRROR_NODE_VERSION }}
soloVersion: ${{ env.SOLO_VERSION }}
- name: Set Operator Account
run: |
echo "OPERATOR_KEY=${{ steps.solo.outputs.ed25519PrivateKey }}" >> $GITHUB_ENV
echo "OPERATOR_ID=${{ steps.solo.outputs.ed25519AccountId }}" >> $GITHUB_ENV
- name: Run Examples
if: success()
run: task run-examples
build-test-tck:
name: Build and Test TCK
runs-on: hiero-client-sdk-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Setup GCC
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gcc libc6-dev libc-dev
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Tidy TCK Modules
run: go mod tidy
working-directory: ./tck
- name: Build TCK
run: go build -v ./...
working-directory: ./tck
- name: Lint TCK
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
skip-cache: true
args: --timeout=5m
working-directory: ./tck