Skip to content

Commit ecefd53

Browse files
seismanweiji14
andauthored
CI: Run benchmarks if PR is labeled with "run/benchmark" (#2958)
Co-authored-by: Wei Ji <[email protected]>
1 parent 1a103ce commit ecefd53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/benchmarks.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ on:
1212
paths:
1313
- 'pygmt/**/*.py'
1414
- '.github/workflows/benchmarks.yml'
15-
# Uncomment the 'pull_request' line below to trigger the workflow in PR
16-
# pull_request:
15+
# Run in PRs but only if the PR has the 'run/benchmark' label
16+
pull_request:
17+
types: [ opened, reopened, labeled, synchronize ]
1718
# `workflow_dispatch` allows CodSpeed to trigger backtest
1819
# performance analysis in order to generate initial data.
1920
workflow_dispatch:
@@ -28,7 +29,7 @@ concurrency:
2829
jobs:
2930
benchmarks:
3031
runs-on: ubuntu-22.04
31-
if: github.repository == 'GenericMappingTools/pygmt'
32+
if: github.repository == 'GenericMappingTools/pygmt' && (github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run/benchmark'))
3233
defaults:
3334
run:
3435
shell: bash -l {0}

0 commit comments

Comments
 (0)