-
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (105 loc) · 4.8 KB
/
Copy pathbackend-matrix.yml
File metadata and controls
116 lines (105 loc) · 4.8 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
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# backend-matrix.yml — Per-prover smoke matrix for vcl-ut → echidna wire.
#
# One matrix job per ProverKind variant. Authoritative list comes from
# echidna's .machine_readable/provers.a2ml (source-of-truth: the
# ProverKind enum in echidna/src/rust/provers/mod.rs). The prep job
# parses provers.a2ml and emits a matrix JSON ephemerally as a GHA
# output — no committed JSON artefact (memory rule: tools emit A2ML,
# not JSON).
#
# Current scope of per-job work:
# - Runs the vcltotal-echidna-client wiremock integration suite
# with the target prover slug injected as ECHIDNA_PROVER env.
# - When echidna's REST surface expands to all 105 backends (today
# it exposes 17), each job can diverge per slug to exercise a
# live echidna container. That upgrade is tracked as Package 4
# step 7; the matrix shape here is ready for it.
#
# Resource budget: max-parallel=3 per the user's standing constraint
# on parallel subagents / bash invocations applied to CI.
name: Backend Matrix
on:
pull_request:
branches: ['**']
push:
branches: [main, master]
workflow_dispatch: {}
permissions:
contents: read
jobs:
prep:
name: Derive matrix from echidna provers.a2ml
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
provers: ${{ steps.parse.outputs.provers }}
count: ${{ steps.parse.outputs.count }}
steps:
- name: Checkout vcl-ut
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Checkout echidna (authoritative ProverKind source)
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: hyperpolymath/echidna
path: echidna
fetch-depth: 1
- name: Parse provers.a2ml → matrix JSON (ephemeral GHA output only)
id: parse
run: |
set -euo pipefail
a2ml=echidna/.machine_readable/provers.a2ml
test -f "$a2ml"
# Extract `slug = "..."` values from each [prover.X] section.
# Keep only the slug; nothing else is needed by the matrix yet.
slugs=$(grep -E '^slug = ' "$a2ml" | sed -E 's/slug = "(.+)"/\1/')
count=$(echo "$slugs" | wc -l | tr -d ' ')
# Convert to JSON array for GitHub Actions matrix consumption.
# (GHA matrix strategies require JSON; this is runtime
# marshalling, not a persisted artefact.)
json=$(printf '%s\n' "$slugs" | jq -R . | jq -sc .)
echo "provers=$json" >> "$GITHUB_OUTPUT"
echo "count=$count" >> "$GITHUB_OUTPUT"
echo "Derived matrix: $count provers"
smoke:
name: Smoke (${{ matrix.prover }})
needs: prep
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
max-parallel: 3
matrix:
prover: ${{ fromJson(needs.prep.outputs.provers) }}
env:
ECHIDNA_PROVER: ${{ matrix.prover }}
steps:
- name: Checkout vcl-ut
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
shared-key: backend-matrix
# The vcl-ut workspace has a path-dependency
# `echidna-core = { path = "../../../echidna/crates/echidna-core" }`
# (src/interface/Cargo.toml), so the whole workspace fails to load
# unless echidna is present as a sibling of the checkout. Provide it.
- name: Provide echidna sibling (echidna-core path-dependency)
run: git clone --depth 1 https://github.com/hyperpolymath/echidna ../echidna
- name: Client wiremock suite (ECHIDNA_PROVER=${{ matrix.prover }})
# `vcltotal-echidna-client` is intentionally NOT a member of the root
# workspace (v0.2.0 workspace cleanup: its transitive echidna-core
# path-dep breaks standalone CI), so `-p` cannot select it. It is its
# own standalone workspace root; run it by manifest path now that the
# echidna sibling has been cloned above.
# NOTE: echidna-client is a standalone workspace with NO committed
# Cargo.lock — its transitive `echidna-core` path-dep only exists once
# the sibling is cloned (step above), so a lockfile cannot be committed
# and `--locked` can never be satisfied: it fails before the tests even
# build ("cannot create the lock file ... because --locked was passed").
# Resolve fresh against the just-cloned sibling instead (omit --locked).
run: cargo test --manifest-path src/interface/echidna-client/Cargo.toml --tests