Bump zizmorcore/zizmor-action from 1c7106082dbc1753372e3924b7da1b9417011a21 to 0f0557ab4a0b31211d42435e42df31cbd63fdd59 in the actions group #798
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Benchmark | |
| on: | |
| pull_request: | |
| concurrency: | |
| group: benchmark-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| working-directory: ./bindings/python | |
| shell: bash | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: ["ubuntu-22.04"] | |
| python-version: ["3.10"] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' | |
| cache-dependency-path: '**/setup.cfg' | |
| - name: Start MongoDB | |
| uses: supercharge/mongodb-github-action@90004df786821b6308fb02299e5835d0dae05d0d # 1.12.0 | |
| with: | |
| mongodb-version: 6.0 | |
| - name: Install deps | |
| run: | | |
| python -m pip install rust-just uv | |
| - name: Install libbson | |
| run: | | |
| just build-libbson | |
| - name: Run benchmarks | |
| run: | | |
| set -eux | |
| run_asv () { | |
| git show --no-patch --format="%H (%s)" | |
| export LIBBSON_INSTALL_DIR=$(pwd)/libbson | |
| just benchmark --set-commit-hash $(git rev-parse HEAD) | |
| } | |
| pip install asv virtualenv | |
| asv machine --yes | |
| git fetch origin main:main | |
| git update-ref refs/bm/pr HEAD | |
| # We know this is a PR run. The branch is a GitHub refs/pull/*/merge ref, so | |
| # the current target that this PR will be merged into is HEAD^1. | |
| git update-ref refs/bm/merge-target $(git log -n 1 --pretty=format:"%H" main --) | |
| git checkout --force refs/bm/pr -- | |
| run_asv | |
| git checkout --force refs/bm/merge-target -- | |
| run_asv | |
| - name: Compare benchmarks | |
| run: | | |
| asv compare --factor 1.2 --split refs/bm/merge-target refs/bm/pr -- | |
| - name: Fail if any benchmarks have slowed down too much | |
| run: | | |
| ! asv compare --factor 1.2 --split refs/bm/merge-target refs/bm/pr 2> /dev/null | grep -q "got worse" |