-
Notifications
You must be signed in to change notification settings - Fork 150
418 lines (371 loc) · 13.1 KB
/
heavy-tests.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
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: Nightly Tests
on:
workflow_dispatch:
schedule:
- cron: 30 1 * * *
jobs:
golangci:
name: Lint
runs-on:
- self-hosted
- linux
container: ubuntu:22.04
steps:
- name: Install dependencies
id: dependencies
run: |
apt update
apt install -y build-essential libstdc++6 software-properties-common make gcc git curl tar
- name: Check out code into the Go module directory
id: checkout
uses: actions/checkout@v4
- name: install go
id: go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Run global scope golangci-lint
id: global_lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.2
args: --timeout 10m0s
skip-pkg-cache: true
- name: Run golangci-lint on wasp-cli
uses: golangci/golangci-lint-action@v3
with:
working-directory: tools/wasp-cli
version: v1.53.2
args: --timeout 10m0s
skip-pkg-cache: true
- name: Get the job name
id: get_job_name
if: "${{ failure() }}"
uses: mikefarah/yq@master
with:
cmd: yq '.jobs.${{ github.job }}.name' .github/workflows/heavy-tests.yml
- name: prepare reporting outputs
if: "${{ failure() }}"
id: prepare_outputs
run: |
apt install jq -y
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e 's:\":\\\":g') >> $GITHUB_OUTPUT
echo "::group::Install JQ"
apt update && apt install jq -y
echo "::endgroup::"
echo "job name result ${{ steps.get_job_name.outputs.result }}"
if [ "${{ steps.get_job_name.outputs.result }}" != "null" ]; then
if [ "${{ matrix.TEST_LANG }}" ]; then
echo job_name="${{ steps.get_job_name.outputs.result }} (${{ matrix.TEST_LANG }})" >> $GITHUB_OUTPUT
else
echo job_name="${{ steps.get_job_name.outputs.result }}" >> $GITHUB_OUTPUT
fi
else
echo job_name=${{ github.job }} >> $GITHUB_OUTPUT
fi
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e
's:\":\\\":g') >> $GITHUB_OUTPUT
- name: The job has failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"job": "${{ github.job }}",
"job_name" : "${{ steps.prepare_outputs.outputs.job_name }}",
"steps": "${{ steps.prepare_outputs.outputs.github_steps }}",
"run_number": "${{ github.run_number }}",
"run_attempt": "${{ github.run_attempt }}",
"workflow": "${{ github.workflow }}",
"sha": "${{ github.sha }}",
"ref": "${{ github.ref_name }}",
"run_id": "${{ github.run_id }}",
"server_url": "${{ github.server_url }}",
"repository": "${{ github.repository }}"
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
contract-test:
name: Wasm contract tests
runs-on:
- self-hosted
- linux
container: ubuntu:22.04
strategy:
matrix:
TEST_LANG:
- go
- gowasm
- tswasm
- rswasm
steps:
- name: Install dependencies
id: dependencies
run: |
apt update
apt install -y build-essential libstdc++6 software-properties-common make gcc git wget curl tar
- name: checkout to the directory
id: checkout
uses: actions/checkout@v4
- name: install golang
id: go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: install tinygo
id: tinygo
run: >
wget
https://github.com/tinygo-org/tinygo/releases/download/v0.27.0/tinygo_0.27.0_amd64.deb
dpkg -i tinygo_0.27.0_amd64.deb
export PATH=$PATH:/usr/local/bin
- name: install rust-toolchain
id: rust
uses: actions-rs/[email protected]
with:
toolchain: stable
- name: install wasm-pack
id: wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: install Node.js
id: node
uses: actions/setup-node@v3
with:
node-version: 18
- name: install schema
id: schema
run: |
git config --global --add safe.directory /__w/wasp/wasp
root_path=$(git rev-parse --show-toplevel)
go install $root_path/tools/schema
schema -go
- name: run builds
env:
TEST_LANG: ${{matrix.TEST_LANG}}
run: |
cd contracts/wasm/scripts
bash core_build.sh
if [ $TEST_LANG == "gowasm" ]; then
bash go_all.sh
elif [ $TEST_LANG == "tswasm" ]; then
bash ts_all.sh
elif [ $TEST_LANG == "rswasm" ]; then
bash rust_all.sh ci
fi
- name: run tests
env:
TEST_LANG: ${{matrix.TEST_LANG}}
run: |
cd contracts/wasm
if [ $TEST_LANG == "go" ]; then
go test ./...
elif [ $TEST_LANG == "gowasm" ]; then
go test ./... -gowasm
elif [ $TEST_LANG == "tswasm" ]; then
go test ./... -tswasm
elif [ $TEST_LANG == "rswasm" ]; then
go test ./... -rswasm
fi
- name: Get the job name
id: get_job_name
if: "${{ failure() }}"
uses: mikefarah/yq@master
with:
cmd: yq '.jobs.${{ github.job }}.name' .github/workflows/heavy-tests.yml
- name: prepare reporting outputs
if: "${{ failure() }}"
id: prepare_outputs
run: |
apt install jq -y
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e 's:\":\\\":g') >> $GITHUB_OUTPUT
echo "::group::Install JQ"
apt update && apt install jq -y
echo "::endgroup::"
echo "job name result ${{ steps.get_job_name.outputs.result }}"
if [ "${{ steps.get_job_name.outputs.result }}" != "null" ]; then
if [ "${{ matrix.TEST_LANG }}" ]; then
echo job_name="${{ steps.get_job_name.outputs.result }} (${{ matrix.TEST_LANG }})" >> $GITHUB_OUTPUT
else
echo job_name="${{ steps.get_job_name.outputs.result }}" >> $GITHUB_OUTPUT
fi
else
echo job_name=${{ github.job }} >> $GITHUB_OUTPUT
fi
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e
's:\":\\\":g') >> $GITHUB_OUTPUT
- name: The job has failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"job": "${{ github.job }}",
"job_name" : "${{ steps.prepare_outputs.outputs.job_name }}",
"steps": "${{ steps.prepare_outputs.outputs.github_steps }}",
"run_number": "${{ github.run_number }}",
"run_attempt": "${{ github.run_attempt }}",
"workflow": "${{ github.workflow }}",
"sha": "${{ github.sha }}",
"ref": "${{ github.ref_name }}",
"run_id": "${{ github.run_id }}",
"server_url": "${{ github.server_url }}",
"repository": "${{ github.repository }}"
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"
test:
name: Test
runs-on:
- self-hosted
container: ubuntu:22.04
steps:
- name: Install dependencies
id: dependencies
run: |
apt update
apt install -y build-essential libstdc++6 software-properties-common make gcc git curl tar
- name: Check out code into the Go module directory
id: checkout
uses: actions/checkout@v4
- name: Set up Go 1.x
id: go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Cache Hornet
id: cache_hornet
uses: actions/[email protected]
with:
key: hornet-${{ hashFiles('**/go.mod', '**/go.sum') }}
path: |
/usr/local/bin/hornet
/usr/local/bin/inx-indexer
/usr/local/bin/inx-coordinator
/usr/local/bin/inx-faucet
- name: Checkout Hornet
id: hornet
uses: actions/checkout@v4
if: steps.cache_hornet.outputs.cache-hit != 'true'
with:
repository: iotaledger/hornet
ref: ${{ vars.HORNET_VERSION }}
path: hornet
- name: Build hornet
id: build_hornet
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd hornet
go mod download
go mod verify
go build -o /usr/local/bin/hornet -a -tags=rocksdb -ldflags='-w -s'
- name: Checkout Indexer
id: inx-indexer
if: steps.cache_hornet.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: iotaledger/inx-indexer
ref: ${{ vars.INX_INDEXER_VERSION }}
path: inx-indexer
- name: Build Indexer
id: build_indexer
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd inx-indexer
go mod download
go mod verify
go build -o /usr/local/bin/inx-indexer -a
- name: Checkout Coordinator
id: inx_coordinator
if: steps.cache_hornet.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: iotaledger/inx-coordinator
ref: ${{ vars.INX_COORDINATOR_VERSION }}
path: inx-coordinator
- name: Build Coordinator
id: build_coordinator
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd inx-coordinator
go mod download
go mod verify
go build -o /usr/local/bin/inx-coordinator -a
- name: Checkout Faucet
id: inx-faucet
if: steps.cache_hornet.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: iotaledger/inx-faucet
ref: ${{ vars.INX_FAUCET_VERSION }}
path: inx-faucet
- name: Build Faucet
id: build_faucet
if: steps.cache_hornet.outputs.cache-hit != 'true'
run: |
cd inx-faucet
go mod download
go mod verify
git submodule update --init --recursive
go build -o /usr/local/bin/inx-faucet -a
- name: Get dependencies
id: go_dependencies
run: |
git config --global --add safe.directory /__w/wasp/wasp
make wasm
go get -v -t -d ./...
- name: Build
id: build
run: make build
- name: Test
id: test
run: |
make test GIT_REF_TAG="v0.0.0+${{ github.sha }}"
make test-full GIT_REF_TAG="v0.0.0+${{ github.sha }}"
- name: Get the job name
id: get_job_name
if: "${{ failure() }}"
uses: mikefarah/yq@master
with:
cmd: yq '.jobs.${{ github.job }}.name' .github/workflows/heavy-tests.yml
- name: prepare reporting outputs
if: "${{ failure() }}"
id: prepare_outputs
run: |
apt install jq -y
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e 's:\":\\\":g') >> $GITHUB_OUTPUT
echo "::group::Install JQ"
apt update && apt install jq -y
echo "::endgroup::"
echo "job name result ${{ steps.get_job_name.outputs.result }}"
if [ "${{ steps.get_job_name.outputs.result }}" != "null" ]; then
if [ "${{ matrix.TEST_LANG }}" ]; then
echo job_name="${{ steps.get_job_name.outputs.result }} (${{ matrix.TEST_LANG }})" >> $GITHUB_OUTPUT
else
echo job_name="${{ steps.get_job_name.outputs.result }}" >> $GITHUB_OUTPUT
fi
else
echo job_name=${{ github.job }} >> $GITHUB_OUTPUT
fi
echo github_steps=$(echo '${{ toJSON(steps) }}' | jq -r -c . | sed -e
's:\":\\\":g') >> $GITHUB_OUTPUT
- name: The job has failed
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"job": "${{ github.job }}",
"job_name" : "${{ steps.prepare_outputs.outputs.job_name }}",
"steps": "${{ steps.prepare_outputs.outputs.github_steps }}",
"run_number": "${{ github.run_number }}",
"run_attempt": "${{ github.run_attempt }}",
"workflow": "${{ github.workflow }}",
"sha": "${{ github.sha }}",
"ref": "${{ github.ref_name }}",
"run_id": "${{ github.run_id }}",
"server_url": "${{ github.server_url }}",
"repository": "${{ github.repository }}"
}
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_WEBHOOK_URL }}"