diff --git a/.github/workflows/asv.yml b/.github/workflows/asv.yml index 19a841ab..2dd3209f 100644 --- a/.github/workflows/asv.yml +++ b/.github/workflows/asv.yml @@ -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