Skip to content

Commit 72d3fe4

Browse files
committed
Run Phase 2 smoke gates on pull requests
1 parent 628e852 commit 72d3fe4

3 files changed

Lines changed: 47 additions & 14 deletions

File tree

.github/workflows/phase2-packet-capture.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Phase 2 Packet Capture A-B
22

33
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled]
46
workflow_dispatch:
57
inputs:
68
scenario:
@@ -47,9 +49,22 @@ permissions:
4749

4850
jobs:
4951
packet-capture-ab:
50-
name: Paper 26.1.2 packet ABBA (${{ inputs.scenario }})
52+
name: Paper 26.1.2 packet ABBA
53+
if: >-
54+
github.event_name == 'workflow_dispatch' ||
55+
github.event.action != 'labeled' ||
56+
github.event.label.name == 'phase2-packet-static-formal' ||
57+
github.event.label.name == 'phase2-packet-visibility-formal'
5158
runs-on: ubuntu-latest
5259
timeout-minutes: 100
60+
env:
61+
CAMPAIGN_SCENARIO: ${{ github.event_name == 'workflow_dispatch' && inputs.scenario || github.event.label.name == 'phase2-packet-visibility-formal' && 'visibility-return' || 'static-spawn' }}
62+
CAMPAIGN_RUNS: ${{ github.event_name == 'workflow_dispatch' && inputs.runs || github.event.action == 'labeled' && '12' || '4' }}
63+
CAMPAIGN_ITEMS: ${{ github.event_name == 'workflow_dispatch' && inputs.items || github.event.action == 'labeled' && '4096' || '1024' }}
64+
CAMPAIGN_WARMUP_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.warmup_seconds || github.event.action == 'labeled' && '60' || '10' }}
65+
CAMPAIGN_SETTLE_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.settle_seconds || github.event.action == 'labeled' && '10' || '5' }}
66+
CAMPAIGN_MEASURE_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.measure_seconds || github.event.action == 'labeled' && '10' || '5' }}
67+
CAMPAIGN_SNAPLEN: ${{ github.event_name == 'workflow_dispatch' && inputs.snaplen || '128' }}
5368

5469
steps:
5570
- name: Check out immutable test source
@@ -110,13 +125,13 @@ jobs:
110125

111126
- name: Run restart-isolated packet ABBA campaign
112127
env:
113-
SCENARIO: ${{ inputs.scenario }}
114-
RUNS: ${{ inputs.runs }}
115-
ITEMS: ${{ inputs.items }}
116-
WARMUP_SECONDS: ${{ inputs.warmup_seconds }}
117-
SETTLE_SECONDS: ${{ inputs.settle_seconds }}
118-
MEASURE_SECONDS: ${{ inputs.measure_seconds }}
119-
SNAPLEN: ${{ inputs.snaplen }}
128+
SCENARIO: ${{ env.CAMPAIGN_SCENARIO }}
129+
RUNS: ${{ env.CAMPAIGN_RUNS }}
130+
ITEMS: ${{ env.CAMPAIGN_ITEMS }}
131+
WARMUP_SECONDS: ${{ env.CAMPAIGN_WARMUP_SECONDS }}
132+
SETTLE_SECONDS: ${{ env.CAMPAIGN_SETTLE_SECONDS }}
133+
MEASURE_SECONDS: ${{ env.CAMPAIGN_MEASURE_SECONDS }}
134+
SNAPLEN: ${{ env.CAMPAIGN_SNAPLEN }}
120135
run: |
121136
set -euo pipefail
122137
[[ "$SCENARIO" == static-spawn || "$SCENARIO" == visibility-return ]]

.github/workflows/phase2-runtime-ab.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Phase 2 Clean Runtime A-B
22

33
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled]
46
workflow_dispatch:
57
inputs:
68
runs:
@@ -36,8 +38,18 @@ permissions:
3638
jobs:
3739
clean-runtime-ab:
3840
name: Paper 26.1.2 clean TPS-MSPT ABBA
41+
if: >-
42+
github.event_name == 'workflow_dispatch' ||
43+
github.event.action != 'labeled' ||
44+
github.event.label.name == 'phase2-runtime-formal'
3945
runs-on: ubuntu-latest
4046
timeout-minutes: 130
47+
env:
48+
CAMPAIGN_RUNS: ${{ github.event_name == 'workflow_dispatch' && inputs.runs || github.event.action == 'labeled' && '12' || '4' }}
49+
CAMPAIGN_ITEMS: ${{ github.event_name == 'workflow_dispatch' && inputs.items || github.event.action == 'labeled' && '4096' || '1024' }}
50+
CAMPAIGN_WARMUP_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.warmup_seconds || github.event.action == 'labeled' && '120' || '10' }}
51+
CAMPAIGN_SETTLE_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.settle_seconds || github.event.action == 'labeled' && '20' || '5' }}
52+
CAMPAIGN_MEASURE_SECONDS: ${{ github.event_name == 'workflow_dispatch' && inputs.measure_seconds || github.event.action == 'labeled' && '180' || '10' }}
4153

4254
steps:
4355
- name: Check out immutable test source
@@ -89,11 +101,11 @@ jobs:
89101

90102
- name: Run restart-isolated clean ABBA campaign
91103
env:
92-
RUNS: ${{ inputs.runs }}
93-
ITEMS: ${{ inputs.items }}
94-
WARMUP_SECONDS: ${{ inputs.warmup_seconds }}
95-
SETTLE_SECONDS: ${{ inputs.settle_seconds }}
96-
MEASURE_SECONDS: ${{ inputs.measure_seconds }}
104+
RUNS: ${{ env.CAMPAIGN_RUNS }}
105+
ITEMS: ${{ env.CAMPAIGN_ITEMS }}
106+
WARMUP_SECONDS: ${{ env.CAMPAIGN_WARMUP_SECONDS }}
107+
SETTLE_SECONDS: ${{ env.CAMPAIGN_SETTLE_SECONDS }}
108+
MEASURE_SECONDS: ${{ env.CAMPAIGN_MEASURE_SECONDS }}
97109
run: |
98110
set -euo pipefail
99111
[[ "$RUNS" =~ ^(4|8|12)$ ]]

docs/phase2-performance-validation.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ Pktmon 只能证明传输行为,不能证明朝向、高度、遮挡、动画
497497

498498
## 11. GitHub 隔离运行门
499499

500-
仓库提供两个**手动触发且互相独立**的运行门;它们不会在普通 PR 检查中自动消耗长时间 runner:
500+
仓库提供两个**互相独立**的运行门;默认分支可手动触发,普通 PR 只自动运行短烟测,不会自动消耗
501+
正式长跑所需的 runner 时间:
501502

502503
- `.github/workflows/phase2-runtime-ab.yml`:不启动抓包、JFR 或 profiler,使用真实 Paper JVM 与真实
503504
26.1.2 TCP play-state 客户端,按 `ABBA / BAAB / ABBA` 重启 12 次,只用于 `observedTps`
@@ -516,3 +517,8 @@ lifecycle scripts,并保存完整 lockfile、依赖树和逐文件 SHA-256。
516517

517518
正式结论必须使用默认 12 runs、120 秒预热、20 秒稳定和 180 秒 clean 采样。4/8 runs 仅用于验证
518519
harness;GitHub shared runner 的结果若接近噪声阈值,应在专用 self-hosted runner 上用同一套脚本复测。
520+
521+
新 workflow 尚未进入默认分支时,GitHub 不允许直接 `workflow_dispatch`。因此 PR 的
522+
opened/synchronize/reopened 事件只跑 4 runs、1024 items 的短烟测;添加 `phase2-runtime-formal`
523+
`phase2-packet-static-formal``phase2-packet-visibility-formal` 标签才会分别启动对应的 12-run 正式门。
524+
其他标签不会误触发长任务。

0 commit comments

Comments
 (0)