forked from kkrt-labs/kakarot-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
213 lines (208 loc) · 7.33 KB
/
rust_test.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
---
name: rust test
on:
workflow_call:
jobs:
fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all --check
test:
runs-on: ubuntu-latest-16-cores
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Setup rust env
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
toolchain: 1.80.0
- name: Retrieve cached dependencies
uses: Swatinem/rust-cache@v2
# nextest setup
- uses: taiki-e/install-action@nextest
# Install Foundry
- name: install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# Install Python
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10.14
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-${{ runner.os }}
- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Setup the Kakarot submodule
run: make setup
# Create dump
- name: Create dump
run: ./scripts/make_with_env.sh katana-genesis
- name: Lint
run: |
cargo check &&
cargo clippy --workspace --all-features --all-targets -- -D warnings
- name: Test code
run: make test
# Inspired by Reth CI.
# <https://github.com/paradigmxyz/reth/blob/027d50fc105fd527dca0bf56fe51b7240f119e66/.github/workflows/hive.yml>
hive-prepare:
runs-on: ubuntu-latest-16-cores
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- run: mkdir artifacts
- name: Build Hive
uses: docker/build-push-action@v4
with:
push: false
tags: hive
context: .
file: ./docker/hive/Dockerfile
platforms: linux/amd64
build-args: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
APIBARA_STARKNET_BIN_DIR=ns4qwsl6fgbv7mxhxpnaqhd66wnic8i6
APIBARA_SINK_BIN_DIR=sci7y4a8r7yz05094pl88h3d7vv1s98f
outputs: type=docker,dest=./artifacts/kakarot_image.tar
- name: Checkout hive tests
uses: actions/checkout@v4
with:
repository: kkrt-labs/hive
ref: master
path: hivetests
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Compile hive
run: |
cd hivetests
go build hive.go
mv ./hive ../artifacts/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: ./artifacts
hive-test:
runs-on: ubuntu-latest-16-cores
timeout-minutes: 45
needs: hive-prepare
strategy:
fail-fast: false
matrix:
sim: [ethereum/rpc]
include:
- sim: ethereum/rpc-compat
include:
- debug_getRawReceipts
- debug_getRawTransaction/get-tx$
- debug_getRawBlock/get-invalid-number$
- eth_blockNumber/simple-test$
- eth_call/call-simple-contract$
- eth_call/call-simple-transfer$
- eth_chainId/get-chain-id$
- eth_estimateGas/estimate-simple-contract$
- eth_estimateGas/estimate-simple-transfer$
- eth_getBalance/get-balance$
- eth_getBlockByHash/get-block-by-empty-hash$
- eth_getBlockByHash/get-block-by-notfound-hash$
- eth_getBlockByNumber/get-finalized$
- eth_getBlockByNumber/get-latest$
- eth_getBlockByNumber/get-safe$
- eth_getBlockByNumber/get-block-notfound$
- eth_getBlockByNumber/get-block-n$
- eth_getBlockReceipts/get-block-receipts-0$
- eth_getBlockReceipts/get-block-receipts-earliest$
- eth_getBlockReceipts/get-block-receipts-empty$
- eth_getBlockReceipts/get-block-receipts-latest$
- eth_getBlockReceipts/get-block-receipts-future$
- eth_getBlockReceipts/get-block-receipts-n$
- eth_getBlockReceipts/get-block-receipts-not-found$
- eth_getBlockTransactionCountByNumber/get-block-n$
- eth_getBlockTransactionCountByNumber/get-genesis$
- eth_getCode/get-code$
- eth_getStorage/get-storage$
- eth_getTransactionByBlockNumberAndIndex/get-block-n$
- eth_getTransactionByHash/get-access-list$
- eth_getTransactionByHash/get-dynamic-fee$
- eth_getTransactionByHash/get-empty-tx$
- eth_getTransactionByHash/get-legacy-create$
- eth_getTransactionByHash/get-legacy-input$
- eth_getTransactionByHash/get-legacy-tx$
- eth_getTransactionByHash/get-notfound-tx$
- eth_getTransactionReceipt/get-access-list$
- eth_getTransactionReceipt/get-dynamic-fee$
- eth_getTransactionReceipt/get-empty-tx$
- eth_getTransactionReceipt/get-legacy-receipt$
- eth_getTransactionReceipt/get-notfound-tx$
- eth_getTransactionReceipt/get-legacy-contract$
- eth_getTransactionReceipt/get-legacy-input$
- eth_sendRawTransaction/send-access-list-transaction$
- eth_sendRawTransaction/send-dynamic-fee-access-list-transaction$
- eth_sendRawTransaction/send-dynamic-fee-transaction$
- eth_sendRawTransaction/send-legacy-transaction$
- eth_getTransactionCount/get-account-nonce$
- eth_syncing/check-syncing$
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: /tmp
- name: Load Docker image
run: |
docker load --input /tmp/kakarot_image.tar
docker image ls -a
- name: Move hive binary
run: |
mv /tmp/hive /usr/local/bin
chmod +x /usr/local/bin/hive
- name: Checkout hive tests
uses: actions/checkout@v4
with:
repository: kkrt-labs/hive
ref: master
path: hivetests
- name: Run ${{ matrix.sim }} simulator
run: |
cd hivetests
hive --sim "${{ matrix.sim }}$" --sim.limit "/${{join(matrix.include, '|')}}" --client kakarot
- name: Print logs
if: always()
run: |
cd hivetests
echo "Logs:"
cat workspace/logs/*.log
echo "Kakarot logs:"
cat workspace/logs/kakarot/*.log
echo "Details logs:"
cat workspace/logs/details/*.log