-
Notifications
You must be signed in to change notification settings - Fork 225
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
Changes from 6 commits
cbb94f4
1c99d10
17c7bbe
328453c
5abc3a9
553e691
6d42078
0d0e17f
ada3aa5
d59efb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ 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 | ||
pull_request: | ||
# `workflow_dispatch` allows CodSpeed to trigger backtest | ||
# performance analysis in order to generate initial data. | ||
workflow_dispatch: | ||
|
@@ -28,7 +28,7 @@ concurrency: | |
jobs: | ||
benchmarks: | ||
runs-on: ubuntu-22.04 | ||
if: github.repository == 'GenericMappingTools/pygmt' | ||
if: github.repository == 'GenericMappingTools/pygmt' && contains(github.event.pull_request.labels.*.name, 'run/benchmark') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I'm unsure if the workflow will run in the main branch, because it's a push event not a pull_request event. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried in my own fork. It doesn't work in the main branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the
Now it works in my own fork, see the changes between my fork and the pygmt repository: main...seisman:pygmt:main and the workflow was triggered when pushing in the main branch (https://github.com/seisman/pygmt/actions/workflows/benchmarks.yml). |
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
There was a problem hiding this comment.
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 therun/benchmark
label gets added to PRs that might affect performance? Or just rely on the maintainers to set the label for now?There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.