Skip to content

Commit 538e714

Browse files
Fix benchmark workflow triggers
Closes #1164
1 parent 77c6d67 commit 538e714

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/asv_benchmark_pr.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
name: Benchmark PR
22

33
on:
4+
push:
45
pull_request:
5-
branches: [main]
6+
types: [synchronize, labeled]
67
workflow_dispatch:
78
env:
89
PYTHON_VERSION: "3.10"
910
WORKING_DIR: ${{ github.workspace }}/benchmarks
1011
BENCHMARKS_OUTPUT: ${{ github.workspace }}/benchmarks_output
1112

13+
permissions:
14+
contents: read
15+
16+
# Cancels all previous workflow runs for pull requests that have not completed.
17+
concurrency:
18+
# The concurrency group contains the workflow name and the branch name for pull requests
19+
# or the commit hash for any other events.
20+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
21+
cancel-in-progress: true
22+
1223
jobs:
1324
benchmark-pr:
1425
runs-on: ubuntu-latest
15-
if: contains(github.event.pull_request.labels.*.name, 'run_benchmarks') || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run'
26+
if: ${{ contains(github.event.pull_request.labels.*.name, 'run-benchmarks') || github.ref == 'refs/heads/main' }}
1627

1728
defaults:
1829
run:

0 commit comments

Comments
 (0)