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
|
name: CI benchmarks
on:
pull_request:
types: [synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
benchmarks:
if: |
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Run benchmarks')
runs-on: ubuntu-latest
steps:
- name: Checkout sunpy repo
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libopencv-dev
python -m pip install --upgrade pip
pip install asv virtualenv
- name: Add machine info for ASV
run: asv machine --yes
- name: Run benchmarks
id: asv
shell: bash -e {0}
env:
OPENBLAS_NUM_THREADS: 1
MKL_NUM_THREADS: 1
OMP_NUM_THREADS: 1
ASV_FACTOR: 1.1
BASE_SHA: ${{ github.event.pull_request.base.sha }}
COLUMNS: 150 # set a large terminal width so that large tables are rendered in 2D
run: |
ASV_OPTIONS="--show-stderr --factor $ASV_FACTOR --cpu-affinity 0"
echo "TEXT<<EOF" >> $GITHUB_OUTPUT
asv continuous $ASV_OPTIONS ${BASE_SHA} ${GITHUB_SHA} 2>&1 | tee -a $GITHUB_OUTPUT
status=${PIPESTATUS[0]}
echo "EOF" >> $GITHUB_OUTPUT
exit $status
- name: Post the summary
if: always()
run: |
echo "${{ steps.asv.outputs.TEXT }}" | egrep "\| *Change *\| *Before *\[|BENCHMARKS NOT SIGNIFICANTLY CHANGED." -A 1000 | tee -a $GITHUB_STEP_SUMMARY
|