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
|
name: Benchmarks
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1' # Every Monday at 6am UTC
push:
branches:
- main
- '*.x'
tags:
- '*'
pull_request:
types:
- synchronize
- labeled
# Only cancel in-progress jobs or runs for the current workflow
# This cancels the already triggered workflows for a specific PR without canceling
# other instances of this workflow (other PRs, scheduled triggers, etc) when something
# within that PR re-triggers this CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
codspeed:
if: (github.repository == 'asdf-format/asdf' && (github.event_name == 'schedule' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'Benchmarks')))
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install dependencies
run: pip install pytest-codspeed .[benchmark]
- uses: CodSpeedHQ/action@v4
with:
run: pytest benchmarks/ --codspeed --codspeed-mode simulation
mode: simulation
token: ${{ secrets.CODSPEED_TOKEN }}
|