Repository navigation
157 lines (143 loc) · 6.01 KB
/
Copy pathclient-compat.yml
File metadata and controls
157 lines (143 loc) · 6.01 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
# Build and test the two production clients against this spawned checkout.
#
# ethrex and ethlambda keep a `spawned-v0.8` port branch for this release. This
# workflow checks that branch out, points it at the spawned commit under test
# with a generated `[patch]` section (the client's manifests are not edited;
# see .github/scripts/client-compat-patch.sh) and runs the client's
# spawned-related gates in debug. See docs/TESTING.md, "Client compatibility".
#
# Runs nightly, on every push to main, on PRs labeled `client-compat`, and by
# hand (workflow_dispatch, with optional client refs).
name: Client compatibility
on:
schedule:
- cron: "37 3 * * *"
push:
branches: ["main"]
pull_request:
types: [opened, reopened, synchronize, labeled]
workflow_dispatch:
inputs:
ethrex_ref:
description: "ethrex branch, tag or SHA"
required: false
default: "spawned-v0.8"
ethlambda_ref:
description: "ethlambda branch, tag or SHA"
required: false
default: "spawned-v0.8"
baseline:
description: "Skip the patch: run the gates against the spawned the client pins, to tell a client failure from a spawned regression"
type: boolean
required: false
default: false
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
# Debug builds as the clients ship them, minus full debuginfo: line tables
# keep backtraces readable and roughly halve target/ on a hosted runner.
# Debuginfo does not change codegen, so stack frame sizes are unaffected.
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_PROFILE_TEST_DEBUG: line-tables-only
# Deliberately NOT setting RUST_MIN_STACK: test threads must keep the default
# 2 MiB stack, which is what caught the pre-0.7.1 ethrex stack overflow.
jobs:
client:
name: ${{ matrix.client }}
# On PRs only when labeled `client-compat`; a `labeled` event for another
# label does not start (or cancel) a run.
if: >-
github.event_name != 'pull_request' ||
(contains(github.event.pull_request.labels.*.name, 'client-compat') &&
(github.event.action != 'labeled' || github.event.label.name == 'client-compat'))
runs-on: ubuntu-24.04
timeout-minutes: 75
concurrency:
group: client-compat-${{ matrix.client }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- client: ethrex
repo: lambdaclass/ethrex
ref: ${{ inputs.ethrex_ref || 'spawned-v0.8' }}
- client: ethlambda
repo: lambdaclass/ethlambda
ref: ${{ inputs.ethlambda_ref || 'spawned-v0.8' }}
steps:
# A cold ethrex run grows the disk by about 16 GB. ubuntu-24.04 runners
# currently report ~86 GB free, so the slow cleanup only runs when a
# runner image comes with less.
- name: Free disk space
run: |
df -h /
avail_gb=$(df --output=avail -BG / | tail -1 | tr -dc 0-9)
if [ "$avail_gb" -ge 40 ]; then echo "${avail_gb} GB free, no cleanup needed"; exit 0; fi
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/.ghcup \
/usr/local/share/boost /usr/local/share/powershell /usr/share/swift \
/opt/hostedtoolcache/CodeQL "$AGENT_TOOLSDIRECTORY" || true
sudo docker image prune --all --force > /dev/null || true
df -h /
- name: Checkout spawned
uses: actions/checkout@v4
with:
path: spawned
- name: Checkout ${{ matrix.repo }}@${{ matrix.ref }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: client
- name: Read client toolchain
id: toolchain
working-directory: client
run: |
channel=$(sed -nE 's/^[[:space:]]*channel[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' rust-toolchain.toml)
[ -n "$channel" ] || { echo "::error::no channel in rust-toolchain.toml"; exit 1; }
echo "channel=$channel" >> "$GITHUB_OUTPUT"
echo "client=${{ matrix.repo }}@$(git rev-parse HEAD) (${{ matrix.ref }}), toolchain $channel" | tee -a "$GITHUB_STEP_SUMMARY"
echo "spawned=$(git -C ../spawned rev-parse HEAD)" | tee -a "$GITHUB_STEP_SUMMARY"
- name: Install Rust ${{ steps.toolchain.outputs.channel }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.channel }}
components: clippy
- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: client -> target
shared-key: client-compat-${{ matrix.client }}
# PR refs cannot share their entries; only main (push and schedule) saves.
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Point ${{ matrix.client }} at this spawned checkout
if: ${{ !inputs.baseline }}
run: bash spawned/.github/scripts/client-compat-patch.sh spawned client
- name: Baseline (client's own spawned, no patch)
if: ${{ inputs.baseline }}
working-directory: client
run: |
echo "**Baseline run: gates use the spawned version the client pins, not this checkout.**" >> "$GITHUB_STEP_SUMMARY"
cargo metadata --format-version 1 > "$RUNNER_TEMP/client-metadata.json"
- name: Gates
working-directory: client
env:
CLIENT: ${{ matrix.client }}
run: bash ../spawned/.github/scripts/client-compat-gates.sh "$CLIENT"
- name: Disk usage
if: always()
run: |
df -h /
du -sh client/target 2>/dev/null || true
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: client-compat-${{ matrix.client }}-logs
path: |
${{ runner.temp }}/client-compat-logs/
${{ runner.temp }}/spawned-packages.txt
client/Cargo.lock
client/.cargo/config.toml
retention-days: 14