99 - labeled
1010 - unlabeled
1111 workflow_dispatch :
12- inputs : &workflow_inputs
12+ inputs : &shared_inputs
1313 orchestrated :
1414 description : " Run from the orchestrated image-validation path."
1515 default : false
8282 description : " Relayer version"
8383 default : " "
8484 type : string
85+ compat-test :
86+ description : " Compat-test JSON path or stem under test-suite/fhevm/compat-tests"
87+ default : " "
88+ type : string
89+ rollout-step :
90+ description : " Compat rollout step index to render locally before boot"
91+ default : " "
92+ type : string
8593 lock-artifact-name :
86- description : " Uploaded lock artifact name used to freeze the baseline bundle"
94+ description : " Uploaded lock artifact name used to freeze the resolved bundle"
8795 default : " "
8896 type : string
8997 kms-core-version :
94102 description : " Deployment scenario (e.g. two-of-two, two-of-two-multi-chain)"
95103 default : " two-of-two"
96104 type : string
105+ test-profile :
106+ description : " Named test profile to run instead of the default standard suite"
107+ default : " standard"
108+ type : string
97109 workflow_call :
98110 secrets :
99111 GHCR_READ_TOKEN :
@@ -102,26 +114,26 @@ on:
102114 required : true
103115 CGR_PASSWORD :
104116 required : true
105- inputs : *workflow_inputs
117+ inputs : *shared_inputs
106118
107119permissions : {}
108120
109121# Cancel stale PR runs on new pushes while keeping manual dispatches independent.
110122concurrency :
111- group : ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || 'auto' }}
123+ group : ${{ github.workflow }}-${{ inputs.rollout-step != '' && format('compat-{0}-{1}-{2}', github.event_name == 'pull_request' && github.event.pull_request.number || github.ref, inputs.compat-test || 'default', inputs.rollout-step) || github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || 'auto' }}
112124 cancel-in-progress : ${{ github.event_name == 'pull_request' || github.ref != 'refs/heads/main' }}
113125
114126jobs :
115127 fhevm-e2e-test :
116128 # Run on manual/reusable invocations. For direct PRs, require the `e2e` label.
117- if : ${{ github.event_name != 'pull_request' || inputs.orchestrated || (github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.head_ref, 'mergify/merge-queue/') && contains(github.event.pull_request.labels.*.name, 'e2e')) }}
129+ if : ${{ github.event_name != 'pull_request' || inputs.orchestrated || inputs.compat-test != '' || (github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.head_ref, 'mergify/merge-queue/') && contains(github.event.pull_request.labels.*.name, 'e2e')) }}
118130 permissions :
119131 contents : ' read' # Required to checkout repository code
120132 id-token : ' write' # Required for OIDC authentication
121133 packages : ' read' # Required to read GitHub packages/container registry
122134 env :
123135 GH_TOKEN : ${{ github.token }}
124- BUILD : ${{ inputs.orchestrated && 'false' || github.event_name == 'pull_request' && 'true' || inputs.build && 'true' || 'false' }}
136+ BUILD : ${{ inputs.compat-test != '' && 'false' || inputs. orchestrated && 'false' || github.event_name == 'pull_request' && 'true' || inputs.build && 'true' || 'false' }}
125137 COPROCESSOR_DB_MIGRATION_VERSION : ${{ inputs.coprocessor-db-migration-version }}
126138 COPROCESSOR_HOST_LISTENER_VERSION : ${{ inputs.coprocessor-host-listener-version }}
127139 COPROCESSOR_GW_LISTENER_VERSION : ${{ inputs.coprocessor-gw-listener-version }}
@@ -140,6 +152,7 @@ jobs:
140152 RELAYER_VERSION : ${{ inputs.relayer-version }}
141153 CORE_VERSION : ${{ inputs.kms-core-version }}
142154 SCENARIO : ${{ inputs.scenario || 'two-of-two' }}
155+ TEST_PROFILE : ${{ inputs.test-profile || 'standard' }}
143156 runs-on : large_ubuntu_32
144157 steps :
145158 - name : Checkout code
@@ -181,26 +194,29 @@ jobs:
181194 sudo apt-get install -y gh
182195
183196 - name : Typecheck CLI
197+ if : ${{ inputs.compat-test == '' }}
184198 working-directory : test-suite/fhevm
185199 run : bun run check
186200
187201 - name : Unit test CLI
202+ if : ${{ inputs.compat-test == '' }}
188203 working-directory : test-suite/fhevm
189204 run : bun test src
190205
191206 - name : Compat smoke
207+ if : ${{ inputs.compat-test == '' }}
192208 working-directory : test-suite/fhevm
193209 run : bun run compat-smoke
194210
195211 - name : Download frozen baseline lock
196- if : ${{ inputs.lock-artifact-name != '' }}
212+ if : ${{ inputs.compat-test == '' && inputs. lock-artifact-name != '' }}
197213 uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
198214 with :
199215 name : ${{ inputs.lock-artifact-name }}
200216 path : ${{ runner.temp }}/baseline-lock
201217
202218 - name : Resolve frozen lock path
203- if : ${{ inputs.lock-artifact-name != '' }}
219+ if : ${{ inputs.compat-test == '' && inputs. lock-artifact-name != '' }}
204220 run : |
205221 set -euo pipefail
206222 lock_file="$(find "${RUNNER_TEMP}/baseline-lock" -maxdepth 1 -name '*.json' -print -quit)"
@@ -210,8 +226,49 @@ jobs:
210226 fi
211227 echo "LOCK_FILE=$lock_file" >> "$GITHUB_ENV"
212228
229+ - name : Render compat rollout step
230+ if : ${{ inputs.compat-test != '' }}
231+ working-directory : test-suite/fhevm
232+ env :
233+ COMPAT_TEST_INPUT : ${{ inputs.compat-test }}
234+ ROLLOUT_STEP_INPUT : ${{ inputs.rollout-step }}
235+ run : |
236+ set -euo pipefail
237+ resolve_test() {
238+ local value="$1"
239+ local workspace_value="${GITHUB_WORKSPACE}/${value}"
240+ local compat_dir="${GITHUB_WORKSPACE}/test-suite/fhevm/compat-tests"
241+ if [ -f "$value" ]; then
242+ realpath "$value"
243+ return
244+ fi
245+ if [ -f "$workspace_value" ]; then
246+ realpath "$workspace_value"
247+ return
248+ fi
249+ if [ -f "${compat_dir}/${value}.json" ]; then
250+ realpath "${compat_dir}/${value}.json"
251+ return
252+ fi
253+ if [ -f "${compat_dir}/${value}" ]; then
254+ realpath "${compat_dir}/${value}"
255+ return
256+ fi
257+ echo "Could not resolve compat-test: $value" >&2
258+ exit 1
259+ }
260+ compat_test="$(resolve_test "$COMPAT_TEST_INPUT")"
261+ lock_file="${RUNNER_TEMP}/compat-step.lock.json"
262+ ./fhevm-cli rollout --compat-test "$compat_test" --step "${ROLLOUT_STEP_INPUT:-0}" --out "$lock_file"
263+ echo "LOCK_FILE=$lock_file" >> "$GITHUB_ENV"
264+
265+ - name : Resolve compat local overrides
266+ if : ${{ inputs.compat-test != '' }}
267+ run : |
268+ echo "COMPAT_OVERRIDES=test-suite" >> "$GITHUB_ENV"
269+
213270 - name : Resolve latest-main lock once
214- if : ${{ inputs.lock-artifact-name == '' && !inputs.orchestrated }}
271+ if : ${{ inputs.compat-test == '' && inputs. lock-artifact-name == '' && !inputs.orchestrated }}
215272 working-directory : test-suite/fhevm
216273 run : |
217274 lock_file="$(./fhevm-cli resolve --target latest-main | tail -n1)"
@@ -233,6 +290,12 @@ jobs:
233290 if [ "$BUILD" = "true" ]; then
234291 args+=(--build)
235292 fi
293+ if [ -n "${COMPAT_OVERRIDES:-}" ]; then
294+ IFS=',' read -r -a override_groups <<< "$COMPAT_OVERRIDES"
295+ for group in "${override_groups[@]}"; do
296+ [ -n "$group" ] && args+=(--override "$group")
297+ done
298+ fi
236299 ./fhevm-cli up "${args[@]}" --dry-run
237300
238301 - name : Boot fhevm Stack
@@ -247,19 +310,28 @@ jobs:
247310 if [ "$BUILD" = "true" ]; then
248311 args+=(--build)
249312 fi
313+ if [ -n "${COMPAT_OVERRIDES:-}" ]; then
314+ IFS=',' read -r -a override_groups <<< "$COMPAT_OVERRIDES"
315+ for group in "${override_groups[@]}"; do
316+ [ -n "$group" ] && args+=(--override "$group")
317+ done
318+ fi
250319 ./fhevm-cli up "${args[@]}"
251320
252- - name : Standard e2e suite
321+ - name : Selected e2e suite
253322 working-directory : test-suite/fhevm
254323 run : |
255- ./fhevm-cli test standard
324+ ./fhevm-cli test "$TEST_PROFILE"
256325
257326 - name : Host listener poller test
327+ if : ${{ inputs.test-profile == '' || inputs.test-profile == 'standard' }}
258328 working-directory : test-suite/fhevm
259329 run : |
330+ trap 'docker start coprocessor-host-listener >/dev/null 2>&1 || true' EXIT
260331 docker stop coprocessor-host-listener
261332 ./fhevm-cli test erc20
262333 docker start coprocessor-host-listener
334+ trap - EXIT
263335
264336 - name : Show logs
265337 working-directory : test-suite/fhevm
0 commit comments