-
Notifications
You must be signed in to change notification settings - Fork 41
118 lines (101 loc) · 3.4 KB
/
Copy pathperf-baseline.yml
File metadata and controls
118 lines (101 loc) · 3.4 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
name: Performance Baseline
on:
push:
branches:
- main
- release*
- release/*
- release-*
workflow_dispatch:
permissions:
contents: read
jobs:
performance:
name: Performance Baseline
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Python to PATH
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Validate Snapshot Comparator
run: python -m unittest discover -s scripts/tests -p 'test_*.py' -v
shell: bash
- name: Add Conda to PATH (Windows)
if: startsWith(matrix.os, 'windows')
run: |
$path = $env:PATH + ";" + $env:CONDA + "\condabin"
echo "PATH=$path" >> $env:GITHUB_ENV
- name: Add Conda to PATH (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: echo "PATH=$PATH:$CONDA/condabin" >> $GITHUB_ENV
shell: bash
- name: Install Conda + add to PATH (macOS)
if: startsWith(matrix.os, 'macos')
run: |
curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash ~/miniconda.sh -b -p ~/miniconda
echo "PATH=$PATH:$HOME/miniconda/bin" >> $GITHUB_ENV
echo "CONDA=$HOME/miniconda" >> $GITHUB_ENV
shell: bash
- name: Create test Conda environment
run: conda create -n perf-test-env python=3.12 -y
- name: Create test venv
run: python -m venv .venv
shell: bash
- name: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Cargo Fetch
run: cargo fetch
shell: bash
- name: Build Release
run: cargo build --release --target ${{ matrix.target }}
shell: bash
- name: Run Performance Tests
run: |
set -o pipefail
cargo test --release --features ci-perf --target ${{ matrix.target }} --test e2e_performance test_performance_summary -- --nocapture 2>&1 | tee perf-output.txt
env:
RUST_BACKTRACE: 1
RUST_LOG: warn
shell: bash
- name: Extract Performance Metrics
run: |
if ! grep -q "JSON metrics:" perf-output.txt; then
echo "Performance baseline produced no JSON metrics" >&2
exit 1
fi
sed -n '/JSON metrics:/,/^}/p' perf-output.txt | tail -n +2 > metrics.json
python -m json.tool metrics.json > /dev/null
cat metrics.json
shell: bash
- name: Validate Performance Baseline
run: >-
python scripts/quality_snapshot.py performance
--current metrics.json
--baseline metrics.json
--platform "${{ matrix.os }} baseline"
--report performance-baseline-report.md
--summary "$GITHUB_STEP_SUMMARY"
shell: bash
- name: Upload Performance Baseline Artifact
uses: actions/upload-artifact@v4
with:
name: perf-baseline-${{ matrix.os }}
path: metrics.json
retention-days: 90