File: codspeed.yml

package info (click to toggle)
pydantic-core 2.41.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,000 kB
  • sloc: python: 35,821; javascript: 211; makefile: 128
file content (66 lines) | stat: -rw-r--r-- 1,724 bytes parent folder | download
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: codspeed

on:
  push:
    branches:
      - main
  pull_request:
  # `workflow_dispatch` allows CodSpeed to trigger backtest
  # performance analysis in order to generate initial data.
  workflow_dispatch:

env:
  UV_FROZEN: true
  UV_PYTHON: 3.13

jobs:
  benchmarks:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v5

      # Using this action is still necessary for CodSpeed to work:
      - uses: actions/setup-python@v6
        with:
          python-version: ${{ env.UV_PYTHON}}

      - name: install uv
        uses: astral-sh/setup-uv@v7
        with:
          enable-cache: true

      - name: Install deps
        run: |
          uv sync --group testing
          uv pip uninstall pytest-speed
          uv pip install pytest-benchmark==4.0.0 pytest-codspeed

      - name: Install rust stable
        id: rust-toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: llvm-tools

      - name: Cache rust
        uses: Swatinem/rust-cache@v2

      - name: Build PGO wheel
        id: pgo-wheel
        uses: ./.github/actions/build-pgo-wheel
        with:
          interpreter: ${{ env.UV_PYTHON }}
          rust-toolchain: ${{ steps.rust-toolchain.outputs.name }}
        env:
          # make sure profiling information is present
          CARGO_PROFILE_RELEASE_DEBUG: "line-tables-only"
          CARGO_PROFILE_RELEASE_STRIP: false

      - name: Install PGO wheel
        run: uv pip install ${{ steps.pgo-wheel.outputs.wheel }} --force-reinstall

      - name: Run CodSpeed benchmarks
        uses: CodSpeedHQ/action@v4
        with:
          mode: instrumentation
          run: uv run --group=codspeed pytest tests/benchmarks/ --codspeed