forked from fetchai/agents-aea
-
Notifications
You must be signed in to change notification settings - Fork 16
571 lines (552 loc) · 19.9 KB
/
workflow.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
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
name: AEA framework sanity checks and tests
on:
push:
branches:
- develop
- main
pull_request:
env:
IS_CI_WORKFLOW: True
jobs:
common_checks_1:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install pipenv
- name: Pipenv install requirements and check it can be locked
run: |
pipenv --clear
time pipenv install --verbose --dev --skip-lock
time pipenv run pip install -e .[all]
time pipenv run pip install --no-deps file:plugins/aea-ledger-ethereum
time pipenv run pip install --no-deps file:plugins/aea-ledger-ethereum-flashbots
time pipenv run pip install --no-deps file:plugins/aea-ledger-cosmos
time pipenv run pip install --no-deps file:plugins/aea-ledger-fetchai
time pipenv run pip install --no-deps file:plugins/aea-ledger-solana
time pipenv lock
- name: Check plugin consistency
run: |
# check diff between plugins' LICENSE and main LICENSE
diff LICENSE plugins/aea-ledger-ethereum/LICENSE
diff LICENSE plugins/aea-ledger-cosmos/LICENSE
diff LICENSE plugins/aea-ledger-fetchai/LICENSE
common_checks_2:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
- name: Security Check
run: tox -e bandit
- name: Safety Check
run: tox -e safety
- name: Code style check
run: |
tox -e black-check
tox -e isort-check
tox -e flake8
- name: Docstring check
run: tox -e darglint
- name: Unused code check
run: tox -e vulture
- name: Static type check
run: tox -e mypy
- name: Golang code style check (aealite)
uses: golangci/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
version: v1.45.2
args: --version
working-directory: libs/go/aealite
common_checks_3:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
- name: Pylint check
run: |
tox -e pylint
common_checks_4:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
pip install --user --upgrade setuptools
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
# install IPFS
sudo apt-get install -y wget
wget -O ./go-ipfs.tar.gz https://dist.ipfs.tech/go-ipfs/v0.6.0/go-ipfs_v0.6.0_linux-amd64.tar.gz
tar xvfz go-ipfs.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
ipfs init
make protolint_install
- name: License Check
run: tox -e liccheck
- name: AEA Package Hashes Check
run: tox -e hash-check
- name: Check package versions in documentation
run: tox -e package-version-checks
- name: Check package dependencies
run: tox -e package-dependencies-checks
- name: Check dependencies
run: tox -e check-dependencies
- name: Check generate protocols
run: tox -e check-generate-all-protocols
- name: Generate Documentation
run: tox -e docs
copyright_check:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
pip install --user --upgrade setuptools
- name: Copyright Check
run: tox -e check-copyright
common_checks_5:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.base_ref == 'main'
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
- name: Install markdown-spellcheck
run: sudo npm install -g markdown-spellcheck
- name: Check API Docs updated
run: tox -e check-api-docs
- name: Check spelling
run: tox -e spell-check
docs_link_check:
continue-on-error: True
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.base_ref == 'main'
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
- name: Check Docs links and IPFS hashes
run: tox -e check-doc-links-hashes
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- run: |
wget https://github.com/zricethezav/gitleaks/releases/download/v8.10.1/gitleaks_8.10.1_linux_x64.tar.gz && \
tar -xzf gitleaks_8.10.1_linux_x64.tar.gz && \
sudo install gitleaks /usr/bin && \
gitleaks detect --report-format json --report-path leak_report
dependencies_checks:
continue-on-error: False
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
python_version: ["3.10",]
timeout-minutes: 10
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python_version }}
- name: Install tox
run: |
pip install tomte[tox]==0.2.13
- name: Check Pipfile and tox.ini consistency
run: |
python ./scripts/check_pipfile_and_toxini.py
- name: Install current aea
run: |
pip install -e .[all]
- name: Check aea dependencies and imports
run: |
tox -e dependencies-check
plugins_install_check:
continue-on-error: False
runs-on: ${{ matrix.sys.os }}
env:
PYTHONUTF8: 1
strategy:
matrix:
sys:
- { os: windows-latest, shell: "msys2 {0}" }
- { os: ubuntu-latest, shell: bash }
# - { os: macos-12, shell: bash }
python_version: ["3.10",]
timeout-minutes: 15
steps:
- uses: actions/checkout@master
- if: matrix.sys.os == 'windows-latest'
uses: msys2/setup-msys2@v2
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python_version }}
- name: Install tox
run: |
pip install tomte[tox]==0.2.13
- name: Check plugin aea-ledger-cosmos
run: |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-cosmos && aea generate-key cosmos && echo aea-ledger-cosmos checked!"
- name: Check plugin aea-ledger-ethereum
run: |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-ethereum && aea generate-key ethereum && echo aea-ledger-ethereum checked!"
- name: Check plugin aea-ledger-ethereum-hwi
run: |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-ethereum && pip install ./plugins/aea-ledger-ethereum-hwi && echo aea-ledger-hwi checked!"
- name: Check plugin aea-ledger-fetchai
run: |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-cosmos && pip install ./plugins/aea-ledger-fetchai && aea generate-key fetchai && echo aea-ledger-fetchai checked!"
- name: Check plugin aea-cli-ipfs
run: |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-cli-ipfs && aea ipfs --help && echo aea-cli-ipfs checked!"
- name: Check plugin aea-ledger-solana
run: |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-solana && aea generate-key solana && echo aea-ledger-solana checked!"
protolint:
continue-on-error: False
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- name: Install protolint (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
make protolint_install
- name: Protolint check
run: |
make protolint
integration_checks:
continue-on-error: True
needs:
- common_checks_1
- common_checks_2
- common_checks_3
- common_checks_4
- dependencies_checks
- plugins_install_check
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
# pull pre-built images
docker pull valory/open-acn-node:latest
- name: Framework integration tests
run: tox -e py3.10 -- -m 'integration and not unstable and not ledger and not profiling'
- name: Packages integration tests
run: tox -e packages-py3.10 -- -m 'integration and not unstable and not ledger and not profiling'
profiling_checks:
continue-on-error: True
needs:
- common_checks_1
- common_checks_2
- common_checks_3
- common_checks_4
- dependencies_checks
- plugins_install_check
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
- name: Framework integration tests
run: tox -e py3.10 -- -m 'profiling'
integration_checks_ledger:
continue-on-error: True
needs:
- common_checks_1
- common_checks_2
- common_checks_3
- common_checks_4
- dependencies_checks
- plugins_install_check
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
- name: Framework integration tests
run: tox -e py3.10 -- -m 'integration and not unstable and ledger and not profiling'
- name: Packages integration tests
run: tox -e packages-py3.10 -- -m 'integration and not unstable and ledger and not profiling'
platform_checks:
continue-on-error: True
needs:
- common_checks_1
- common_checks_2
- common_checks_3
- common_checks_4
- dependencies_checks
- plugins_install_check
env:
PYTHONUTF8: 1 # mostly for windows to work properly with utf8 files
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
python_version: ['3.8', '3.9', '3.10', '3.11']
timeout-minutes: 120
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python_version }}
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- if: matrix.os == 'ubuntu-latest'
name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.13
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
make protolint_install
# install ipfs
wget https://dist.ipfs.tech/go-ipfs/v0.6.0/go-ipfs_v0.6.0_linux-amd64.tar.gz
tar -xvzf go-ipfs_v0.6.0_linux-amd64.tar.gz
cd go-ipfs
sudo ./install.sh
cd ..
rm -rf go-ipfs
ipfs init
mkdir ~/.config/solana
echo "[6,206,143,203,220,22,227,247,237,23,114,181,56,70,53,98,224,64,192,221,134,115,153,146,252,81,8,41,237,224,225,176,195,11,129,62,207,146,39,47,172,98,101,87,102,166,105,202,33,169,134,76,27,149,148,68,4,15,215,47,196,227,216,48]" > ~/.config/solana/id.json
# sudo apt-get install -y protobuf-compiler
# use sudo rm /var/lib/apt/lists/lock above in line above update if dependency install failures persist
# use sudo apt-get dist-upgrade above in line below update if dependency install failures persist
- if: matrix.os == 'macos-12'
name: Install dependencies (macos-12)
run: |
pip install tomte[tox]==0.2.13
brew install gcc
# brew install protobuf
# brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/72457f0166d5619a83f508f2345b22d0617b5021/Formula/protobuf.rb
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-osx-x86_64.zip
unzip protoc-24.3-osx-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
brew tap yoheimuta/protolint
brew install protolint
# install ipfs
curl -O https://dist.ipfs.tech/go-ipfs/v0.6.0/go-ipfs_v0.6.0_darwin-amd64.tar.gz
tar -xvzf go-ipfs_v0.6.0_darwin-amd64.tar.gz
cd go-ipfs
sudo ./install.sh
cd ..
rm -rf go-ipfs
ipfs init
mkdir ~/.config/solana
echo "[6,206,143,203,220,22,227,247,237,23,114,181,56,70,53,98,224,64,192,221,134,115,153,146,252,81,8,41,237,224,225,176,195,11,129,62,207,146,39,47,172,98,101,87,102,166,105,202,33,169,134,76,27,149,148,68,4,15,215,47,196,227,216,48]" > ~/.config/solana/id.json
- if: matrix.os == 'windows-latest'
name: Install dependencies (windows-latest)
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
python -m pip install -U pip
echo "::add-path::C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
choco install protoc --version 24.3
choco install mingw -y
choco install make -y
# to check make was installed
make --version
pip install tomte[tox]==0.2.13
# wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-win64.zip
# unzip protoc-24.3-win64.zip -d protoc
# sudo mv protoc/bin/protoc /usr/local/bin/protoc
python scripts/update_symlinks_cross_platform.py
make protolint_install_win
# just check protolint runs
protolint version
curl https://dist.ipfs.tech/go-ipfs/v0.6.0/go-ipfs_v0.6.0_windows-amd64.zip -o go-ipfs_v0.6.0.zip
Expand-Archive -Path go-ipfs_v0.6.0.zip -DestinationPath ~\Apps\
cp ~\Apps\go-ipfs\ipfs.exe C:\Users\runneradmin\go\bin\
ipfs init
- if: True
name: Framework unit tests
run: |
tox -e py${{ matrix.python_version }} -- -m 'not integration and not unstable and not profiling'
- name: Packages unit tests
run: |
tox -e packages-py${{ matrix.python_version }} -- -m 'not integration and not unstable and not profiling'
- name: Plugin unit tests
run: |
tox -e plugins-py${{ matrix.python_version }} -- -m 'not integration and not unstable and not profiling'
- if: matrix.os == 'ubuntu-latest' && matrix.python_version == '3.10'
name: Show full coverage report
run: |
pip install tomte[tests]==0.2.13
coverage report -m -i
- if: matrix.os == 'ubuntu-latest' && matrix.python_version == '3.10'
name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
golang_checks:
continue-on-error: True
needs:
- common_checks_1
- common_checks_2
- common_checks_3
- common_checks_4
- dependencies_checks
- plugins_install_check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-12, windows-latest]
python-version: ["3.10"]
timeout-minutes: 45
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"