Skip to content

test: prove subprocess and production coverage (Fixes #534) (#562) #136

test: prove subprocess and production coverage (Fixes #534) (#562)

test: prove subprocess and production coverage (Fixes #534) (#562) #136

Workflow file for this run

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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set Python to PATH
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: perf-baseline-${{ matrix.os }}
path: metrics.json
retention-days: 90