File: benchmark.yml

package info (click to toggle)
python-anndata 0.12.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,616 kB
  • sloc: python: 21,685; makefile: 23
file content (66 lines) | stat: -rw-r--r-- 1,664 bytes parent folder | download | duplicates (2)
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
name: Benchmark

on:
  push:
    branches: [main, "[0-9]+.[0-9]+.x"]
  pull_request:
    branches: [main]

env:
  FORCE_COLOR: "1"

defaults:
  run:
    # Add `-l` to GitHub’s default bash options to activate mamba environments
    # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#exit-codes-and-error-action-preference
    # https://github.com/mamba-org/setup-micromamba/#readme
    shell: bash -elo pipefail {0}

jobs:
  benchmark:
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        python: ["3.12"]
        os: [ubuntu-latest]

    env:
      OS: ${{ matrix.os }}
      PYTHON: ${{ matrix.python }}
      ASV_DIR: "./benchmarks"

    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
          # no blob filter so asv can checkout other commits

      - run: git fetch origin main:main
        if: ${{ github.ref_name != 'main' }}
        # Errors on main branch

      - uses: mamba-org/setup-micromamba@v2
        with:
          environment-name: asv
          cache-environment: true
          # Deps documented in https://asv.readthedocs.io/en/latest/installing.html
          create-args: >-
            python=${{ matrix.python }}
            asv
            py_rattler
            conda-build

      - name: Cache datasets
        uses: actions/cache@v4
        with:
          path: |
            ~/.cache
          key: benchmark-state-${{ hashFiles('benchmarks/**') }}

      - name: Quick benchmark run
        working-directory: ${{ env.ASV_DIR }}
        run: |
          asv machine --yes
          asv run --quick --show-stderr --verbose