-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (98 loc) · 4.12 KB
/
Copy pathperformance.yml
File metadata and controls
119 lines (98 loc) · 4.12 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
# Performance Regression CI
# Runs on every push/PR to detect performance regressions early
# Fails if thresholds are exceeded
name: Performance Regression
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: perf-${{ github.ref }}
cancel-in-progress: true
jobs:
performance-check:
name: Performance Regression Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run Performance Benchmarks
id: benchmark
run: |
echo "🚀 Running performance regression tests..."
./gradlew :common:desktopTest \
--tests "*PerformanceBenchmarkTest*" \
--tests "*PerformanceRegressionTest*" \
--no-daemon \
--console=plain 2>&1 | tee benchmark-output.txt
- name: Check for Regressions
run: |
echo "📊 Checking for performance regressions..."
# Check if tests passed
if grep -q "BUILD SUCCESSFUL" benchmark-output.txt; then
echo "✅ All performance tests passed - no regressions detected"
echo "PERFORMANCE_STATUS=pass" >> $GITHUB_ENV
else
echo "❌ Performance regression detected!"
echo "PERFORMANCE_STATUS=fail" >> $GITHUB_ENV
exit 1
fi
- name: Generate Performance Summary
if: always()
run: |
mkdir -p performance-results
cat <<EOF > performance-results/summary.md
# Performance Regression Report
**Commit:** \`${{ github.sha }}\`
**Branch:** \`${{ github.ref_name }}\`
**Date:** $(date -u +"%Y-%m-%d %H:%M UTC")
**Status:** ${{ env.PERFORMANCE_STATUS == 'pass' && '✅ PASS' || '❌ FAIL' }}
## Thresholds
| Metric | Target | Status |
|--------|--------|--------|
| Full URL Analysis | <50ms | ${{ env.PERFORMANCE_STATUS == 'pass' && '✅' || '❌' }} |
| P99 Latency | <50ms | ${{ env.PERFORMANCE_STATUS == 'pass' && '✅' || '❌' }} |
| Heuristics Engine | <10ms | ${{ env.PERFORMANCE_STATUS == 'pass' && '✅' || '❌' }} |
| ML Inference | <5ms | ${{ env.PERFORMANCE_STATUS == 'pass' && '✅' || '❌' }} |
| Brand Detection | <15ms | ${{ env.PERFORMANCE_STATUS == 'pass' && '✅' || '❌' }} |
| Throughput | >100 URLs/sec | ${{ env.PERFORMANCE_STATUS == 'pass' && '✅' || '❌' }} |
## Why This Matters
- **User Experience:** <50ms analysis enables real-time feedback during QR scanning
- **Battery Life:** Fast execution minimizes CPU time and energy consumption
- **Responsiveness:** No UI jank or delay during analysis
EOF
cat performance-results/summary.md
- name: Upload Performance Report
uses: actions/upload-artifact@v4
if: always()
with:
name: performance-report
path: performance-results/
retention-days: 30
- name: Comment on PR
if: github.event_name == 'pull_request' && always()
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
let report = '## 📊 Performance Check\n\n';
try {
report += fs.readFileSync('performance-results/summary.md', 'utf8');
} catch (e) {
report += '${{ env.PERFORMANCE_STATUS == "pass" && "✅ All performance tests passed!" || "❌ Performance regression detected!" }}';
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: report
});