File: benchmark.yaml

package info (click to toggle)
pypdf 6.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 18,184 kB
  • sloc: python: 48,595; makefile: 35
file content (53 lines) | stat: -rw-r--r-- 1,513 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
name: Benchmarking pypdf
on:
  push:
    branches:
      - main

permissions:
  contents: write
  deployments: write

jobs:
  benchmark:
    name: "Benchmark ${{ matrix.name }}"
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.x']
        include:
          - python-version: '3.x'
            name: 'CPython'
          - python-version: 'pypy3.11'
            name: 'PyPy 3.11'
    steps:
    - name: Checkout Code
      uses: actions/checkout@v6
      with:
        submodules: 'recursive'
    - name: Setup Python
      uses: actions/setup-python@v6
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install requirements
      run: |
        pip install -r requirements/ci-3.11.txt
    - name: Install pypdf
      run: |
        pip install .
    - name: Run benchmark
      run: |
        pytest tests/bench.py --benchmark-json output.json
    - name: Store benchmark result
      uses: benchmark-action/github-action-benchmark@v1
      with:
        name: "${{ matrix.name }} Benchmark"
        tool: 'pytest'
        output-file-path: output.json
        # Use personal access token instead of GITHUB_TOKEN due to https://github.community/t/github-action-not-triggering-gh-pages-upon-push/16096
        github-token: ${{ secrets.GITHUB_TOKEN }}
        auto-push: true
        # Show alert with commit comment on detecting possible performance regression
        alert-threshold: '200%'
        comment-on-alert: true
        fail-on-alert: true