Skip to content

Commit

Permalink
CI: Run benchmarks if PR is labeled with "run/benchmark" (#2958)
Browse files Browse the repository at this point in the history
Co-authored-by: Wei Ji <[email protected]>
  • Loading branch information
seisman and weiji14 authored Jan 7, 2024
1 parent 1a103ce commit ecefd53
Showing 1 changed file with 4 additions and 3 deletions.
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
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

0 comments on commit ecefd53

Please sign in to comment.