1616jobs :
1717 format-and-lint :
1818 name : Format & Lint
19- runs-on : ubuntu-latest-4-cores
19+ runs-on : ubuntu-latest
2020 steps :
2121 - uses : actions/checkout@v4
2222
3939
4040 test :
4141 name : Test
42- runs-on : ubuntu-latest-4-cores
42+ runs-on : ubuntu-latest
4343 steps :
4444 - uses : actions/checkout@v4
4545
@@ -59,116 +59,3 @@ jobs:
5959
6060 - name : Build examples
6161 run : cargo build --examples
62-
63- benchmark-regression :
64- name : Benchmark Regression Check
65- runs-on : ubuntu-latest-8-cores
66- permissions :
67- pull-requests : write
68- steps :
69- - uses : actions/checkout@v4
70- with :
71- fetch-depth : 0
72-
73- - name : Setup Rust toolchain
74- uses : actions-rust-lang/setup-rust-toolchain@v1
75- with :
76- cache-on-failure : true
77-
78- - name : Install protoc
79- uses : arduino/setup-protoc@v2
80- with :
81- version : " 25.x"
82- repo-token : ${{ secrets.GITHUB_TOKEN }}
83-
84- - name : Restore benchmark baseline
85- id : cache-baseline
86- uses : actions/cache@v4
87- with :
88- path : scripts/perf/baselines
89- key : benchmark-baseline-${{ github.base_ref || 'main' }}-${{ github.sha }}
90- restore-keys : |
91- benchmark-baseline-${{ github.base_ref || 'main' }}-
92-
93- - name : Run benchmark regression check
94- if : github.event_name == 'pull_request' && steps.cache-baseline.outputs.cache-hit == 'true'
95- id : regression-check
96- continue-on-error : true
97- run : |
98- set -o pipefail
99- ./scripts/perf/compare_to_baseline.sh | tee benchmark-results.txt
100- echo "EXIT_CODE=${PIPESTATUS[0]}" >> $GITHUB_OUTPUT
101-
102- - name : Post regression results to PR
103- if : github.event_name == 'pull_request' && steps.cache-baseline.outputs.cache-hit == 'true'
104- uses : actions/github-script@v7
105- with :
106- script : |
107- const fs = require('fs');
108- let resultsText = '';
109- try {
110- resultsText = fs.readFileSync('benchmark-results.txt', 'utf8');
111- } catch (e) {
112- resultsText = 'Failed to read benchmark results';
113- }
114-
115- const hasRegressions = '${{ steps.regression-check.outputs.EXIT_CODE }}' !== '0';
116- const status = hasRegressions ? '❌ **Benchmark Regression Detected**' : '✅ **No Benchmark Regressions**';
117-
118- const body = `## ${status}
119-
120- <details>
121- <summary>Benchmark Comparison Results</summary>
122-
123- \`\`\`
124- ${resultsText}
125- \`\`\`
126-
127- </details>
128-
129- ${hasRegressions ? '\n⚠️ **This PR contains performance regressions >10% and cannot be merged.**\n\nPlease optimize the code or update the baseline if this regression is intentional.' : ''}
130- `;
131-
132- const { data: comments } = await github.rest.issues.listComments({
133- owner: context.repo.owner,
134- repo: context.repo.repo,
135- issue_number: context.issue.number,
136- });
137-
138- const botComment = comments.find(comment =>
139- comment.user.type === 'Bot' &&
140- comment.body.includes('Benchmark')
141- );
142-
143- if (botComment) {
144- await github.rest.issues.updateComment({
145- owner: context.repo.owner,
146- repo: context.repo.repo,
147- comment_id: botComment.id,
148- body: body
149- });
150- } else {
151- await github.rest.issues.createComment({
152- owner: context.repo.owner,
153- repo: context.repo.repo,
154- issue_number: context.issue.number,
155- body: body
156- });
157- }
158-
159- - name : Fail if regressions detected
160- if : github.event_name == 'pull_request' && steps.regression-check.outputs.EXIT_CODE != '0'
161- run : |
162- echo "❌ Benchmark regressions detected (>10% threshold)"
163- exit 1
164-
165- - name : Update baseline on main branch
166- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
167- run : ./scripts/perf/run_baseline.sh
168-
169- - name : Save new baseline
170- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
171- uses : actions/cache/save@v4
172- with :
173- path : scripts/perf/baselines
174- key : benchmark-baseline-main-${{ github.sha }}
0 commit comments