-
Notifications
You must be signed in to change notification settings - Fork 2.1k
259 lines (232 loc) · 9.99 KB
/
test-suite-e2e-tests.yml
File metadata and controls
259 lines (232 loc) · 9.99 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
name: test-suite-e2e-tests
# Github does not support more than 10 inputs for workflow_dispatch:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#providing-inputs
# Core, relayer and test-suite will use the default versions defined in the `fhevm-cli` script
on:
workflow_dispatch:
inputs:
connector_version:
description: "Connector Version"
default: ""
type: string
db_migration_version:
description: "Coprocessor DB Migration Image Version"
default: ""
type: string
host_version:
description: "Host Image Version"
default: ""
type: string
gateway_version:
description: "Gateway Image Version"
required: false
default: ""
type: string
host_listener_version:
description: "Host Listener Image Version"
default: ""
type: string
gateway_listener_version:
description: "Gateway Listener Image Version"
default: ""
type: string
tx_sender_version:
description: "Transaction Sender Image Version"
default: ""
type: string
tfhe_worker_version:
description: "TFHE Worker Image Version"
default: ""
type: string
sns_worker_version:
description: "SNS Worker Image Version"
default: ""
type: string
zkproof_worker_version:
description: "ZKProof Worker Image Version"
default: ""
type: string
pull_request:
branches:
- main
- release/*
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:
check-changes:
name: test-suite-e2e-tests/check-changes
permissions:
actions: 'read' # Required to read workflow run information
contents: 'read' # Required to checkout repository code
pull-requests: 'read' # Required to read pull request information
runs-on: ubuntu-latest
outputs:
changes-fhevm: ${{ steps.filter.outputs.fhevm }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
fhevm:
- 'test-suite/fhevm/**'
fhevm-e2e-test:
name: test-suite-e2e-tests/fhevm-e2e-test (bpr)
needs: check-changes
if: ${{ needs.check-changes.outputs.changes-fhevm == 'true' || github.event_name == 'release' || github.event_name == 'workflow_dispatch' }}
permissions:
contents: 'read' # Required to checkout repository code
id-token: 'write' # Required for OIDC authentication
packages: 'read' # Required to read GitHub packages/container registry
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: 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: Set version from release
if: github.event_name == 'release'
run: |
{
echo "CONNECTOR_DB_MIGRATION_VERSION=${GH_REF_NAME}"
echo "CONNECTOR_GW_LISTENER_VERSION=${GH_REF_NAME}"
echo "CONNECTOR_KMS_WORKER_VERSION=${GH_REF_NAME}"
echo "CONNECTOR_TX_SENDER_VERSION=${GH_REF_NAME}"
echo "DB_MIGRATION_VERSION=${GH_REF_NAME}"
echo "GATEWAY_VERSION=${GH_REF_NAME}"
echo "HOST_VERSION=${GH_REF_NAME}"
echo "HOST_LISTENER_VERSION=${GH_REF_NAME}"
echo "GW_LISTENER_VERSION=${GH_REF_NAME}"
echo "TX_SENDER_VERSION=${GH_REF_NAME}"
echo "TFHE_WORKER_VERSION=${GH_REF_NAME}"
echo "SNS_WORKER_VERSION=${GH_REF_NAME}"
echo "ZKPROOF_WORKER_VERSION=${GH_REF_NAME}"
} >> "$GITHUB_ENV"
env:
GH_REF_NAME: ${{ github.ref_name }}
- name: Deploy fhevm Stack
working-directory: test-suite/fhevm
env:
CONNECTOR_DB_MIGRATION_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.connector_version || env.CONNECTOR_DB_MIGRATION_VERSION }}
CONNECTOR_GW_LISTENER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.connector_version || env.CONNECTOR_GW_LISTENER_VERSION }}
CONNECTOR_KMS_WORKER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.connector_version || env.CONNECTOR_KMS_WORKER_VERSION }}
CONNECTOR_TX_SENDER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.connector_version || env.CONNECTOR_TX_SENDER_VERSION }}
DB_MIGRATION_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.db_migration_version || env.DB_MIGRATION_VERSION }}
GATEWAY_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.gateway_version || env.GATEWAY_VERSION }}
HOST_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.host_version || env.HOST_VERSION }}
HOST_LISTENER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.host_listener_version || env.HOST_LISTENER_VERSION }}
GW_LISTENER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.gateway_listener_version || env.GW_LISTENER_VERSION }}
TX_SENDER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.tx_sender_version || env.TX_SENDER_VERSION }}
TFHE_WORKER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.tfhe_worker_version || env.TFHE_WORKER_VERSION }}
SNS_WORKER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.sns_worker_version || env.SNS_WORKER_VERSION }}
ZKPROOF_WORKER_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.zkproof_worker_version || env.ZKPROOF_WORKER_VERSION }}
run: |
./fhevm-cli deploy
# 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: 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: Delegate User Decryption (partial test)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test delegate-user-decryption
- name: Random operators test (subset)
working-directory: test-suite/fhevm
run: |
./fhevm-cli test random-subset
- 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::"
- name: Cleanup
working-directory: test-suite/fhevm
if: always()
run: |
./fhevm-cli clean