From 538e7147bf5085a4dc94bcfe854e3243ebca14f5 Mon Sep 17 00:00:00 2001 From: "Brandon T. Willard" Date: Mon, 23 Sep 2024 16:09:12 -0500 Subject: [PATCH] Fix benchmark workflow triggers Closes #1164 --- .github/workflows/asv_benchmark_pr.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/asv_benchmark_pr.yml b/.github/workflows/asv_benchmark_pr.yml index 90fb47423..d7546f854 100644 --- a/.github/workflows/asv_benchmark_pr.yml +++ b/.github/workflows/asv_benchmark_pr.yml @@ -1,18 +1,29 @@ name: Benchmark PR on: + push: pull_request: - branches: [main] + types: [synchronize, labeled] workflow_dispatch: env: PYTHON_VERSION: "3.10" WORKING_DIR: ${{ github.workspace }}/benchmarks BENCHMARKS_OUTPUT: ${{ github.workspace }}/benchmarks_output +permissions: + contents: read + +# Cancels all previous workflow runs for pull requests that have not completed. +concurrency: + # The concurrency group contains the workflow name and the branch name for pull requests + # or the commit hash for any other events. + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} + cancel-in-progress: true + jobs: benchmark-pr: runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, 'run_benchmarks') || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run' + if: ${{ contains(github.event.pull_request.labels.*.name, 'run-benchmarks') || github.ref == 'refs/heads/main' }} defaults: run: