diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index ae900ac31d5..b6cb5e89a68 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -17,6 +17,9 @@ on: # `workflow_dispatch` allows CodSpeed to trigger backtest # performance analysis in order to generate initial data. workflow_dispatch: + # support slash command + repository_dispatch: + types: [benchmark-command] release: types: - published @@ -37,10 +40,22 @@ jobs: # Checkout current git repository - name: Checkout uses: actions/checkout@v4.1.1 + if: github.event_name != 'repository_dispatch' with: # fetch all history so that setuptools-scm works fetch-depth: 0 + # Checkout the pull request branch + - name: Checkout + uses: actions/checkout@v4.1.1 + if: github.event_name == 'repository_dispatch' + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} + ref: ${{ github.event.client_payload.pull_request.head.ref }} + # fetch all history so that setuptools-scm works + fetch-depth: 0 + # Install Miniconda with conda-forge dependencies - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v3.0.1 diff --git a/.github/workflows/slash-command-dispatch.yml b/.github/workflows/slash-command-dispatch.yml index ac7e4df9933..804543532be 100644 --- a/.github/workflows/slash-command-dispatch.yml +++ b/.github/workflows/slash-command-dispatch.yml @@ -1,6 +1,10 @@ # Support slash commands in pull requests # -# Currently, two slash commands `format` and `test-gmt-dev` are supported. +# Supported slash commands: +# +# - `/benchmark` +# - `/format` +# - `/test-gmt-dev` # name: Slash Command Dispatch on: @@ -18,6 +22,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} commands: | + benchmark format test-gmt-dev issue-type: pull-request