-
Notifications
You must be signed in to change notification settings - Fork 2.2k
287 lines (258 loc) · 10.1 KB
/
test-suite-e2e-tests.yml
File metadata and controls
287 lines (258 loc) · 10.1 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
name: test-suite-e2e-tests
on:
workflow_dispatch:
inputs: &workflow_inputs
coprocessor-db-migration-version:
description: "Coprocessor DB Migration Image Version"
default: ""
type: string
coprocessor-host-listener-version:
description: "Coprocessor Host Listener Image Version"
default: ""
type: string
coprocessor-gw-listener-version:
description: "Coprocessor Gateway Listener Image Version"
default: ""
type: string
coprocessor-tx-sender-version:
description: "Coprocessor Transaction Sender Image Version"
default: ""
type: string
coprocessor-tfhe-worker-version:
description: "Coprocessor TFHE Worker Image Version"
default: ""
type: string
coprocessor-sns-worker-version:
description: "Coprocessor SNS Worker Image Version"
default: ""
type: string
coprocessor-zkproof-worker-version:
description: "Coprocessor ZKProof Worker Image Version"
default: ""
type: string
gateway-version:
description: "Gateway version"
default: ""
type: string
host-version:
description: "Host version"
default: ""
type: string
connector-db-migration-version:
description: "KMS Connector DB Migration Image Version"
default: ""
type: string
connector-gw-listener-version:
description: "KMS Connector Gateway Listener Image Version"
default: ""
type: string
connector-kms-worker-version:
description: "KMS Connector KMS Worker Image Version"
default: ""
type: string
connector-tx-sender-version:
description: "KMS Connector Transaction Sender Image Version"
default: ""
type: string
test-suite-version:
description: "Test suite version"
default: ""
type: string
relayer-version:
description: "Relayer version"
default: ""
type: string
kms-core-version:
description: "KMS Core version"
default: ""
type: string
deploy-build:
description: "Build local Docker images from the checked out repository before deploy"
default: false
type: boolean
workflow_call:
secrets:
GHCR_READ_TOKEN:
required: true
CGR_USERNAME:
required: true
CGR_PASSWORD:
required: true
inputs: *workflow_inputs
permissions: {}
# Allow to run multiple instances of the same workflow in parallel when triggered manually
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || 'auto' }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
fhevm-e2e-test:
permissions:
contents: 'read' # Required to checkout repository code
id-token: 'write' # Required for OIDC authentication
packages: 'read' # Required to read GitHub packages/container registry
env:
COPROCESSOR_DB_MIGRATION_VERSION: ${{ inputs.coprocessor-db-migration-version }}
COPROCESSOR_HOST_LISTENER_VERSION: ${{ inputs.coprocessor-host-listener-version }}
COPROCESSOR_GW_LISTENER_VERSION: ${{ inputs.coprocessor-gw-listener-version }}
COPROCESSOR_TX_SENDER_VERSION: ${{ inputs.coprocessor-tx-sender-version }}
COPROCESSOR_TFHE_WORKER_VERSION: ${{ inputs.coprocessor-tfhe-worker-version }}
COPROCESSOR_SNS_WORKER_VERSION: ${{ inputs.coprocessor-sns-worker-version }}
COPROCESSOR_ZKPROOF_WORKER_VERSION: ${{ inputs.coprocessor-zkproof-worker-version }}
GATEWAY_VERSION: ${{ inputs.gateway-version }}
HOST_VERSION: ${{ inputs.host-version }}
CONNECTOR_DB_MIGRATION_VERSION: ${{ inputs.connector-db-migration-version }}
CONNECTOR_GW_LISTENER_VERSION: ${{ inputs.connector-gw-listener-version }}
CONNECTOR_KMS_WORKER_VERSION: ${{ inputs.connector-kms-worker-version }}
CONNECTOR_TX_SENDER_VERSION: ${{ inputs.connector-tx-sender-version }}
TEST_SUITE_VERSION: ${{ inputs.test-suite-version }}
RELAYER_VERSION: ${{ inputs.relayer-version }}
CORE_VERSION: ${{ inputs.kms-core-version }}
runs-on: large_ubuntu_32
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- name: Setup Docker
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_READ_TOKEN }}
- name: Login to Chainguard Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: cgr.dev
username: ${{ secrets.CGR_USERNAME }}
password: ${{ secrets.CGR_PASSWORD }}
- name: Display component versions
env:
JSON_INPUT: ${{ toJSON(inputs) }}
run: |
echo "Component versions: $JSON_INPUT"
- name: Deploy fhevm Stack
working-directory: test-suite/fhevm
env:
DEPLOY_BUILD: ${{ inputs.deploy-build }}
run: |
if [[ "$DEPLOY_BUILD" == 'true' ]]; then
./fhevm-cli deploy --build --coprocessors 2 --coprocessor-threshold 2
else
./fhevm-cli deploy --coprocessors 2 --coprocessor-threshold 2
fi
# E2E tests on pausing the Host contracts
- name: Pause Host Contracts
working-directory: test-suite/fhevm
run: |
./fhevm-cli pause host
- name: Paused Host contracts test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test paused-host-contracts
- name: Unpause Host Contracts
working-directory: test-suite/fhevm
run: |
./fhevm-cli unpause host
# E2E tests on pausing the Gateway contracts
- name: Pause Gateway Contracts
working-directory: test-suite/fhevm
run: |
./fhevm-cli pause gateway
- name: Paused Gateway contracts test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test paused-gateway-contracts
- name: Unpause Gateway Contracts
working-directory: test-suite/fhevm
run: |
./fhevm-cli unpause gateway
# E2E tests after unpausing the Host and Gateway contracts
- name: Input proof test (uint64)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test input-proof
- name: Input proof test with compute and decrypt (uint64)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test input-proof-compute-decrypt
- name: User Decryption test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test user-decryption
- name: Delegated User Decryption test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test delegated-user-decryption
- name: ERC20 test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test erc20
- name: Public Decryption HTTP endpoint test (ebool)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test public-decrypt-http-ebool
- name: Public Decryption HTTP endpoint test (mixed)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test public-decrypt-http-mixed
- name: Random operators test (subset)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test random-subset
- name: HCU block cap test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test hcu-block-cap
- name: Ciphertext drift test
working-directory: test-suite/fhevm
run: |
./fhevm-cli test ciphertext-drift
- name: Host listener poller test
working-directory: test-suite/fhevm
run: |
docker stop coprocessor-host-listener
./fhevm-cli test erc20
docker start coprocessor-host-listener
- name: Show logs on test failure
working-directory: test-suite/fhevm
if: always()
run: |
echo "::group::Relayer Logs"
./fhevm-cli logs fhevm-relayer
echo "::endgroup::"
echo "::group::SNS Worker Logs"
./fhevm-cli logs coprocessor-sns-worker | grep -v "Selected 0 rows to process"
echo "::endgroup::"
echo "::group::Transaction Sender Logs (filtered)"
./fhevm-cli logs coprocessor-transaction-sender | grep -v "Selected 0 rows to process"
echo "::endgroup::"
echo "::group::Host Listener"
./fhevm-cli logs coprocessor-host-listener
echo "::endgroup::"
echo "::group::Gateway Listener"
./fhevm-cli logs coprocessor-gw-listener
echo "::endgroup::"
echo "::group::ZKProof Worker"
./fhevm-cli logs coprocessor-zkproof-worker
echo "::endgroup::"
echo "::group::TFHE Worker"
./fhevm-cli logs coprocessor-tfhe-worker
echo "::endgroup::"
echo "::group::Coprocessor 2 - SNS Worker"
./fhevm-cli logs coprocessor-2-sns-worker 2>/dev/null | grep -v "Selected 0 rows to process" || true
echo "::endgroup::"
echo "::group::Coprocessor 2 - Transaction Sender (filtered)"
./fhevm-cli logs coprocessor-2-transaction-sender 2>/dev/null | grep -v "Selected 0 rows to process" || true
echo "::endgroup::"
echo "::group::Coprocessor 2 - TFHE Worker"
./fhevm-cli logs coprocessor-2-tfhe-worker 2>/dev/null || true
echo "::endgroup::"
- name: Cleanup
working-directory: test-suite/fhevm
if: always()
run: |
./fhevm-cli clean