-
Notifications
You must be signed in to change notification settings - Fork 107
191 lines (187 loc) · 6.71 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
---
name: rust test
on:
workflow_call:
jobs:
test:
runs-on: ubuntu-latest-16-cores
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup rust env
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
toolchain: 1.82.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 UV
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: lib/kakarot/uv.lock
- uses: actions/setup-python@v5
with:
python-version-file: lib/kakarot/.python-version
- name: Install asdf & tools
uses: asdf-vm/actions/setup@v3
- name: install scarb
run: |
asdf plugin add scarb
asdf install scarb 2.6.5
asdf install scarb 0.7.0
- name: Setup the Kakarot submodule
run: make setup
# Create dump
- name: Create dump
run: ./scripts/make_with_env.sh katana-genesis
- name: Test code
run: make test-ci
# 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=3l93dydg7m71r66x5wllf1j9czvj7zdk
APIBARA_SINK_BIN_DIR=8z122nm3b42lgknvv5zp7h921n3f6ia6
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