-
Notifications
You must be signed in to change notification settings - Fork 28
209 lines (191 loc) · 7.06 KB
/
Copy pathe2e.yaml
File metadata and controls
209 lines (191 loc) · 7.06 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
---
name: E2E
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
paths-ignore:
- docs/**
- "**.md"
- .claude/**
push:
branches:
- main
paths-ignore:
- docs/**
- "**.md"
- .claude/**
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: build
if: ${{ github.event.pull_request.draft == false || github.event_name != 'pull_request' }}
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
forge-cache-key: ${{ steps.oif-contracts-sha.outputs.key }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout solver
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Checkout oif-contracts
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: openintentsframework/oif-contracts
path: oif-contracts
# forge-std, permit2, the-compact, openzeppelin-contracts, broadcaster
submodules: recursive
# Tracks upstream main. Replace with a commit SHA if you need
# strict reproducibility across CI runs (cache key is keyed on the
# resolved SHA either way, so upstream changes invalidate cleanly).
ref: main
# Forge cache key invalidates on any change to oif-contracts source or
# any submodule. Exposed as job output so e2e shards restore the same
# key without re-checking out oif-contracts.
- name: Resolve oif-contracts source SHA for cache key
id: oif-contracts-sha
working-directory: oif-contracts
run: |
sha="$(git rev-parse HEAD)"
submods="$(git submodule status --recursive | awk '{print $1}' | sort | sha1sum | awk '{print $1}')"
echo "key=${sha}-${submods}" >> "$GITHUB_OUTPUT"
- name: Cache forge build output
id: forge-cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: |
oif-contracts/out
oif-contracts/cache
key: forge-build-${{ runner.os }}-${{ steps.oif-contracts-sha.outputs.key }}
restore-keys: |
forge-build-${{ runner.os }}-
- name: Install Foundry (anvil + forge)
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.4.0
with:
version: stable
- name: Build oif-contracts
if: steps.forge-cache.outputs.cache-hit != 'true'
run: forge build
working-directory: oif-contracts
# Inline rust-toolchain + rust-cache (instead of `prepare` composite)
# so we can pass `shared-key: e2e-suite`, which strips the per-job
# component from the cache key and lets the e2e matrix shards restore
# the build job's compiled `target/`.
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@1.88.0
- name: Cargo cache
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: e2e-suite
- name: Build solver + all e2e test binaries
run: |
cargo build -p solver-service --bin solver --locked
cargo test -p solver-e2e-tests --tests --no-run --locked
e2e:
name: e2e (${{ matrix.test }})
needs: build
permissions:
contents: read
runs-on: ubuntu-latest
timeout-minutes: ${{ matrix.timeout_minutes }}
strategy:
fail-fast: false
matrix:
include:
- test: happy_e2e_open_fill_settle
timeout_minutes: 10
- test: happy_e2e_native_fill_settle
timeout_minutes: 10
- test: submit_e2e_hyperlane
timeout_minutes: 10
- test: permit2_e2e
timeout_minutes: 10
- test: eip3009_e2e
timeout_minutes: 10
- test: deny_list_e2e
timeout_minutes: 10
- test: failure_e2e_onchain
timeout_minutes: 10
- test: failure_e2e_settlement
timeout_minutes: 10
- test: api_e2e_orders
timeout_minutes: 10
- test: admin_api_e2e
timeout_minutes: 10
- test: tx_bump_resilience_e2e
timeout_minutes: 40
services:
# Only admin_api_e2e uses Redis; others ignore REDIS_URL via
# `redis_url_or_skip`. Cheaper to start it in every shard than to fork
# the matrix.
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
env:
REDIS_URL: redis://127.0.0.1:6379
OIF_CONTRACTS_PATH: ${{ github.workspace }}/oif-contracts
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout solver
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Restore forge build output
id: forge-cache
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: |
oif-contracts/out
oif-contracts/cache
key: forge-build-${{ runner.os }}-${{ needs.build.outputs.forge-cache-key }}
# anvil is needed at runtime; forge is only needed for the cache-miss
# fallback below.
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.4.0
with:
version: stable
# Self-heal if the cache was evicted between the build job and now —
# rebuild oif-contracts in this shard instead of taking down the matrix.
- name: Checkout oif-contracts (cache miss fallback)
if: steps.forge-cache.outputs.cache-hit != 'true'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: openintentsframework/oif-contracts
path: oif-contracts
submodules: recursive
ref: main
- name: Build oif-contracts (cache miss fallback)
if: steps.forge-cache.outputs.cache-hit != 'true'
run: forge build
working-directory: oif-contracts
# Same shared-key as the build job — restores its compiled target/.
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@1.88.0
- name: Cargo cache
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: e2e-suite
- name: Run e2e
run: |
cargo test -p solver-e2e-tests --test ${{ matrix.test }} \
--locked -- --ignored --test-threads=1 --nocapture