Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/performance-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,26 @@ jobs:
- name: Run benchmarks
id: benchmark
run: |
npx tsx scripts/ci/benchmark-performance.ts > benchmark-results.json 2>&1 || true
npx tsx scripts/ci/benchmark-performance.ts > benchmark-results.json 2>benchmark-progress.log || true
cat benchmark-progress.log
echo "--- JSON output ---"
cat benchmark-results.json

- name: Validate benchmark JSON
run: |
if ! jq empty benchmark-results.json 2>/dev/null; then
echo "ERROR: benchmark-results.json is not valid JSON"
cat benchmark-results.json
exit 1
fi

- name: Upload results
uses: actions/upload-artifact@v4
with:
name: benchmark-results-${{ github.sha }}
path: benchmark-results.json
path: |
benchmark-results.json
benchmark-progress.log
retention-days: 90

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If JSON validation fails, the job exits before the artifact upload step, so benchmark-progress.log/benchmark-results.json won’t be available as CI artifacts when you most need them for debugging. Consider making the upload step run with if: always() (or move the upload before validation) so artifacts are preserved even when the validation step fails.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Moved the upload step before validation and added if: always() so artifacts are preserved even when validation fails.


- name: Check for regressions
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci/benchmark-performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
* - Docker network creation time
*
* Outputs structured JSON with mean, median, p95, p99 per metric.
*
* IMPORTANT: stdout/stderr contract:
* - stdout (console.log): JSON result only — consumed by the CI workflow via redirect to file
* - stderr (console.error): progress messages and diagnostics — kept separate so JSON stays valid
*/

import { execSync, ExecSyncOptions } from "child_process";
Expand Down
Loading