Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Run benchmarks if PR is labeled with "run/benchmark" #2958

Merged
merged 10 commits into from
Jan 7, 2024
7 changes: 4 additions & 3 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ on:
paths:
- 'pygmt/**/*.py'
- '.github/workflows/benchmarks.yml'
# Uncomment the 'pull_request' line below to trigger the workflow in PR
# pull_request:
# Run in PRs but only if the PR has the 'run/benchmark' label
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we document in .github/PULL_REQUEST_TEMPLATE.md or somewhere for contributors to request that the run/benchmark label gets added to PRs that might affect performance? Or just rely on the maintainers to set the label for now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to leave the jobs to the maintainers. We probably will document it in the contributors guides when addressing #1113.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, or we can put it in doc/maintenance.md somewhere. Not urgent though, since we aren't running the benchmarks that often.

pull_request:
types: [ opened, reopened, labeled, synchronize ]
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
Expand All @@ -28,7 +29,7 @@ concurrency:
jobs:
benchmarks:
runs-on: ubuntu-22.04
if: github.repository == 'GenericMappingTools/pygmt'
if: github.repository == 'GenericMappingTools/pygmt' && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run/benchmark'))
defaults:
run:
shell: bash -l {0}
Expand Down
Loading