forked from Dicklesworthstone/pi_agent_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
281 lines (254 loc) · 10.7 KB
/
conformance.yml
File metadata and controls
281 lines (254 loc) · 10.7 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: Extension Conformance
on:
pull_request:
schedule:
# Nightly full official conformance (02:00 UTC)
- cron: "0 2 * * *"
# Weekly extended conformance (Saturday 02:00 UTC)
- cron: "0 2 * * 6"
workflow_dispatch:
inputs:
profile:
description: "Conformance profile to run"
required: false
default: "auto"
type: choice
options:
- auto
- fast
- full
- weekly
# Deterministic execution settings applied to all jobs.
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
RUST_TEST_THREADS: "1"
PI_TEST_MODE: "1"
PI_TS_ORACLE_TIMEOUT_SECS: "30"
PI_CONFORMANCE_SEED: "42"
jobs:
# ─── Shared setup (reusable via needs) ────────────────────────────────────
conformance-matrix:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pi_agent_rust
shell: bash
strategy:
fail-fast: false
matrix:
include:
# PR: fast conformance (official sample + generated tier 1-2 + negative)
- name: fast-official
if_event: pull_request
test_cmd: cargo test --test ext_conformance_diff --features ext-conformance -- --nocapture
env_extra: "PI_OFFICIAL_MAX=5"
- name: fast-generated
if_event: pull_request
test_cmd: cargo test --test ext_conformance_generated --features ext-conformance -- --nocapture
env_extra: ""
- name: fast-negative
if_event: pull_request
test_cmd: cargo test --test extensions_policy_negative -- --nocapture
env_extra: ""
- name: fast-capability-matrix
if_event: pull_request
test_cmd: cargo test --test capability_denial_matrix -- --nocapture
env_extra: ""
# Nightly: full official + all tiers + scenarios + fixture schema + artifacts
- name: full-official
if_event: nightly
test_cmd: cargo test --test ext_conformance_diff --features ext-conformance -- --nocapture
env_extra: ""
- name: full-generated
if_event: nightly
test_cmd: cargo test --test ext_conformance_generated --features ext-conformance -- --include-ignored --nocapture
env_extra: ""
- name: full-scenarios
if_event: nightly
test_cmd: cargo test --test ext_conformance_scenarios --features ext-conformance -- --nocapture
env_extra: ""
- name: full-negative
if_event: nightly
test_cmd: cargo test --test extensions_policy_negative -- --nocapture
env_extra: ""
- name: full-fixture-schema
if_event: nightly
test_cmd: cargo test --test ext_conformance_fixture_schema -- --nocapture
env_extra: ""
- name: full-artifacts
if_event: nightly
test_cmd: cargo test --test ext_conformance_artifacts -- --nocapture
env_extra: ""
- name: full-report
if_event: nightly
test_cmd: cargo test --test conformance_report generate_conformance_report -- --nocapture
env_extra: ""
# Weekly: community + npm + third-party
- name: weekly-community
if_event: weekly
test_cmd: cargo test --test ext_conformance_diff --features ext-conformance -- --ignored --skip load_time_benchmark_official --skip event_dispatch_latency_benchmark
env_extra: ""
# Conditional: run matrix entries matching the current trigger.
# PR -> fast-*, nightly schedule -> full-*, Saturday schedule -> weekly-*,
# dispatch -> profile input. This cannot live in jobs.<job_id>.if because
# GitHub evaluates job if conditions before matrix expansion.
env:
SHOULD_RUN: ${{ (github.event_name == 'pull_request' && contains(matrix.if_event, 'pull_request')) || (github.event_name == 'schedule' && github.event.schedule == '0 2 * * *' && contains(matrix.if_event, 'nightly')) || (github.event_name == 'schedule' && github.event.schedule == '0 2 * * 6' && contains(matrix.if_event, 'weekly')) || (github.event_name == 'workflow_dispatch' && (inputs.profile == 'auto' || (inputs.profile == 'fast' && contains(matrix.if_event, 'pull_request')) || (inputs.profile == 'full' && contains(matrix.if_event, 'nightly')) || (inputs.profile == 'weekly' && contains(matrix.if_event, 'weekly')))) }}
name: "conformance (${{ matrix.name }})"
steps:
- name: Skip unmatched profile
if: env.SHOULD_RUN != 'true'
run: echo "Skipping ${{ matrix.name }} for event/profile selection"
- name: Free disk space
if: env.SHOULD_RUN == 'true'
working-directory: /
run: |
set -euxo pipefail
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /opt/hostedtoolcache/go \
/opt/hostedtoolcache/Python /opt/hostedtoolcache/Ruby \
/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk \
/usr/local/share/powershell /usr/share/swift \
/usr/local/graalvm /usr/local/.ghcup /usr/local/julia*
sudo docker image prune --all --force || true
sudo apt-get clean || true
df -h /
- name: Checkout pi_agent_rust
if: env.SHOULD_RUN == 'true'
uses: actions/checkout@v4
with:
path: pi_agent_rust
- name: Checkout asupersync
if: env.SHOULD_RUN == 'true'
uses: actions/checkout@v4
with:
repository: Dicklesworthstone/asupersync
path: asupersync
fetch-depth: 1
- name: Checkout rich_rust
if: env.SHOULD_RUN == 'true'
uses: actions/checkout@v4
with:
repository: Dicklesworthstone/rich_rust
path: rich_rust
fetch-depth: 1
- name: Checkout charmed_rust
if: env.SHOULD_RUN == 'true'
uses: actions/checkout@v4
with:
repository: Dicklesworthstone/charmed_rust
path: charmed_rust
fetch-depth: 1
- name: Checkout sqlmodel_rust
if: env.SHOULD_RUN == 'true'
uses: actions/checkout@v4
with:
repository: Dicklesworthstone/sqlmodel_rust
path: sqlmodel_rust
fetch-depth: 1
- name: Install system deps (fd, rg, xcb) [linux]
if: env.SHOULD_RUN == 'true'
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y fd-find ripgrep libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
sudo ln -sf "$(command -v fdfind)" /usr/local/bin/fd
- name: Install Rust toolchain (nightly)
if: env.SHOULD_RUN == 'true'
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Cargo cache
if: env.SHOULD_RUN == 'true'
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
pi_agent_rust/target/
key: conformance-${{ runner.os }}-${{ hashFiles('pi_agent_rust/Cargo.lock') }}
restore-keys: conformance-${{ runner.os }}-
- name: Install Bun
if: env.SHOULD_RUN == 'true'
uses: oven-sh/setup-bun@v1
with:
bun-version: "1.3.8"
- name: Install pi-mono dependencies
if: env.SHOULD_RUN == 'true'
working-directory: pi_agent_rust/legacy_pi_mono_code/pi-mono
run: npm ci
- name: Symlink bun for conformance tests
if: env.SHOULD_RUN == 'true'
run: |
set -euxo pipefail
sudo mkdir -p /home/ubuntu/.bun/bin
sudo ln -sf "$(command -v bun)" /home/ubuntu/.bun/bin/bun
- name: "Run: ${{ matrix.name }}"
if: env.SHOULD_RUN == 'true'
env:
PI_OFFICIAL_MAX: ${{ matrix.env_extra == 'PI_OFFICIAL_MAX=5' && '5' || '' }}
PI_CONFORMANCE_MAX_RETRIES: ${{ contains(matrix.if_event, 'nightly') && '2' || '0' }}
PI_CONFORMANCE_RETRY_DELAY: "10"
run: |
set -euxo pipefail
if [[ "${PI_CONFORMANCE_MAX_RETRIES}" -gt 0 ]]; then
bash scripts/ci_conformance_retry.sh "${{ matrix.name }}" \
${{ matrix.test_cmd }} 2>&1 | tee "conformance-${{ matrix.name }}.log"
else
${{ matrix.test_cmd }} 2>&1 | tee "conformance-${{ matrix.name }}.log"
fi
- name: Upload conformance logs
if: always() && env.SHOULD_RUN == 'true'
uses: actions/upload-artifact@v4
with:
name: conformance-${{ matrix.name }}-${{ github.sha }}
path: |
pi_agent_rust/conformance-${{ matrix.name }}.log
pi_agent_rust/flake_events.jsonl
pi_agent_rust/tests/ext_conformance/reports/**/*.json
pi_agent_rust/tests/ext_conformance/reports/**/*.jsonl
pi_agent_rust/tests/ext_conformance/reports/**/*.md
if-no-files-found: warn
# ─── Trend report (nightly only) ──────────────────────────────────────
trend-report:
needs: [conformance-matrix]
if: >-
github.event_name == 'schedule' && github.event.schedule == '0 2 * * *'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download conformance artifacts
uses: actions/download-artifact@v4
with:
pattern: conformance-full-report-*
merge-multiple: true
- name: Ensure reports dir and summary exist
run: |
set -euxo pipefail
mkdir -p tests/ext_conformance/reports
# download-artifact strips the common pi_agent_rust/ prefix, so the
# summary lands directly in tests/ext_conformance/reports/.
# Verify it exists (it may also already be there from the checkout).
if [ -f tests/ext_conformance/reports/conformance_summary.json ]; then
echo "conformance_summary.json found"
else
echo "WARNING: conformance_summary.json not found after artifact download"
ls -la tests/ext_conformance/reports/ || true
fi
- name: Generate trend entry and report
env:
GIT_SHA: ${{ github.sha }}
GIT_REF: ${{ github.ref_name }}
run: python3 scripts/conformance_trend.py
- name: Upload trend report
uses: actions/upload-artifact@v4
with:
name: conformance-trend-${{ github.sha }}
path: |
tests/ext_conformance/reports/conformance_trend.jsonl
tests/ext_conformance/reports/TREND_REPORT.md
if-no-files-found: warn