-
Notifications
You must be signed in to change notification settings - Fork 30
269 lines (238 loc) · 8.49 KB
/
Copy pathcommon_checks.yaml
File metadata and controls
269 lines (238 loc) · 8.49 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
name: main_workflow
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lock_check:
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-15, windows-2025]
python-version: ["3.10"]
defaults:
run:
shell: bash
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Check if dependencies can be locked
run: uv lock --check
- name: Install dependencies
run: uv sync --all-groups -v
copyright_and_dependencies_check:
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
python-version: ["3.10"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install 'tomte[tox,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
- name: Check copyright headers
run: tomte check-copyright --author valory
- name: License compatibility check
run: tomte tox -e liccheck
- name: Check dependencies
run: tomte tox -e check-dependencies
- name: Check third-party package hashes against upstreams
run: tomte tox -e check-third-party-hashes
- name: Check doc links
run: |
tomte check-doc-links \
--url-skips "https://li.quest/v1/quote" \
--url-skips "https://li.quest/v1/quote/toAmount" \
--url-skips "https://gateway.autonolas.tech/ipfs/" \
--url-skips "https://rpc.gnosischain.com/" \
--url-skips "https://1rpc.io/matic" \
--url-skips "https://omen.subgraph.autonolas.tech"
- name: Check doc IPFS hashes
run: tomte tox -e check-doc-hashes
linter_checks:
continue-on-error: False
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
python-version: ["3.10"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install 'tomte[tox,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
pip install marshmallow==3.26.2
- name: Security checks
run: tomte tox -p -e safety -e bandit
- name: Check packages
run: tomte tox -e check-packages
- name: Check hash
run: tomte tox -e check-hash
- name: Code checks
run: tomte tox -p -e black-check -e isort-check -e flake8 -e mypy -e pylint -e darglint
- name: AbciApp consistency checks
run: |
tomte tox -e check-abci-docstrings
tomte tox -e check-abciapp-specs
tomte tox -e check-handlers
# tomte tox -e analyse-service # analyse-service checks do not work properly as it is checking funds manager skill which is not an ABCI skill
scan:
name: gitleaks
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.10"
- 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
pip install 'tomte[tox,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
tomte tox -e gitleaks
test:
continue-on-error: False
needs:
- lock_check
- copyright_and_dependencies_check
- linter_checks
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-15, windows-2025]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-go@v5
with:
go-version: "1.20.x"
- name: Create decision maker's `store_path` (data folder)
run: mkdir data
- if: matrix.os == 'ubuntu-24.04'
name: Install dependencies (ubuntu-24.04)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install 'tomte[tox,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
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 Tendermint
wget -O tendermint.tar.gz https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_linux_amd64.tar.gz
tar -xf tendermint.tar.gz
sudo mv tendermint /usr/local/bin/tendermint
- if: matrix.os == 'ubuntu-24.04'
name: Packages unit tests ubuntu-24.04
run: |
tomte tox -e py${{ matrix.python-version }}-linux
- if: matrix.os == 'macos-15'
name: Install dependencies (macos-15)
run: |
pip install 'tomte[tox,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
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
- if: matrix.os == 'macos-15'
name: Packages unit tests macos-15
run: |
tomte tox -e py${{ matrix.python-version }}-darwin
- if: matrix.os == 'windows-2025'
name: Install dependencies (windows-2025)
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 wget -y
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,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
- if: matrix.os == 'windows-2025'
name: Packages unit tests windows-2025
run: |
tomte tox -e py${{ matrix.python-version }}-win
coverage:
continue-on-error: False
needs:
- test
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install 'tomte[tox,cli] @ git+https://github.com/valory-xyz/tomte.git@v0.7.0' tox-uv
pip install --user --upgrade setuptools
- name: Check coverage
run: tomte tox -e coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
fail_ci_if_error: false
all_checks_passed:
name: All checks passed
if: always()
needs:
- lock_check
- copyright_and_dependencies_check
- linter_checks
- scan
- test
- coverage
runs-on: ubuntu-24.04
steps:
- name: Fail if any required job failed or was cancelled
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1