-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (109 loc) · 3.68 KB
/
Copy pathperformance.yml
File metadata and controls
126 lines (109 loc) · 3.68 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
name: Performance Benchmarks
on:
push:
branches: [ main ]
paths:
- 'services/**'
- 'attestation-agent/**'
- '.github/workflows/performance.yml'
pull_request:
branches: [ main ]
paths:
- 'services/**'
- 'attestation-agent/**'
schedule:
- cron: '0 4 * * 0' # Weekly on Sunday at 4 AM UTC
workflow_dispatch:
env:
NIX_CONFIG: |
experimental-features = nix-command flakes
accept-flake-config = true
jobs:
service-performance:
name: Service Performance Tests
runs-on: ubuntu-latest
defaults:
run:
shell: "${{ github.workspace }}/scripts/nix-env.sh {0}"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-nix
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
substituters: ${{ vars.SUBSTITUTERS }}
trusted_public_keys: ${{ vars.TRUSTED_PUBLIC_KEYS }}
- name: Run service startup performance tests
run: just test-startup-performance
load-testing:
name: Load Testing
runs-on: ubuntu-latest
needs: service-performance
defaults:
run:
shell: "${{ github.workspace }}/scripts/nix-env.sh {0}"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-nix
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
substituters: ${{ vars.SUBSTITUTERS }}
trusted_public_keys: ${{ vars.TRUSTED_PUBLIC_KEYS }}
- name: Run load testing
run: just test-load
- name: Run memory usage analysis
run: just test-memory-usage
benchmark-comparison:
name: Benchmark Comparison
runs-on: ubuntu-latest
needs: load-testing
if: github.event_name == 'pull_request'
defaults:
run:
shell: "${{ github.workspace }}/scripts/nix-env.sh {0}"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-nix
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
substituters: ${{ vars.SUBSTITUTERS }}
trusted_public_keys: ${{ vars.TRUSTED_PUBLIC_KEYS }}
- name: Build current version
run: just build-all
- name: Quick performance baseline
run: |
echo "=== Current Performance Baseline ==="
# Quick startup time test
time timeout 3s ./build/attestation-agent/bin/attestation-agent &
ATTEST_PID=$!
sleep 1
kill $ATTEST_PID 2>/dev/null || true
echo "Performance baseline recorded for PR comparison"
performance-summary:
name: Performance Summary
runs-on: ubuntu-latest
needs: [service-performance, load-testing, benchmark-comparison]
if: always()
steps:
- name: Performance Test Summary
run: |
echo "=== BlocksenseOS Performance Test Summary ==="
echo ""
echo "⚡ **Performance Test Results:**"
echo "- Service Performance: ${{ needs.service-performance.result }}"
echo "- Load Testing: ${{ needs.load-testing.result }}"
echo "- Benchmark Comparison: ${{ needs.benchmark-comparison.result }}"
echo ""
if [[ "${{ needs.service-performance.result }}" == "success" &&
"${{ needs.load-testing.result }}" == "success" ]]; then
echo "✅ **Performance Status: PASSED**"
echo "All performance tests completed successfully!"
else
echo "⚠️ **Performance Status: ATTENTION REQUIRED**"
echo "Some performance tests require attention. Check the detailed results."
fi