Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 35 additions & 24 deletions .github/workflows/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,58 @@ on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
pull_request:
pull_request:

permissions:
contents: write

jobs:
build:
name: Build and run benchmarks
runs-on: ubuntu-24.04
defaults:
run:
shell: bash -l {0} # required for conda env

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
repository: 'scipp/scipp'
repository: scipp/scipp
ref: main
submodules: true
fetch-depth: 0 # history required so cmake can determine version
fetch-depth: 0

- name: Setup conda environment
uses: mamba-org/setup-micromamba@v2
- uses: actions/checkout@v7
with:
micromamba-version: 2.5.0-1
environment-file: .buildconfig/ci-linux.yml
cache-environment: true
create-args: python=3.11
path: scipp-benchmarks

- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.10.2
with:
path: 'scipp-benchmarks'

- uses: hendrikmuhs/ccache-action@v1.2.20

- run: cmake --preset base
- run: cmake --build --preset build
- run: ctest --preset test
- run: tox -e asv

- uses: stefanzweifel/git-auto-commit-action@v4
pixi-version: v0.76.0
environments: benchmark
frozen: true

- name: Register benchmark machine
run: >
pixi run --frozen -e benchmark asv machine --yes
--machine github-ubuntu-24.04-pixi-py312

- name: Run benchmarks
run: >
pixi run --frozen -e benchmark bench
--machine github-ubuntu-24.04-pixi-py312

- name: Generate benchmark site
run: pixi run --frozen -e benchmark asv publish

- name: Commit benchmark results
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: scipp-benchmarks
branch: main
file_pattern: results/*
commit_message: Update benchmark results

- name: Deploy benchmark results
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
branch: gh_pages
Expand Down