Skip to content

Commit

Permalink
Support slash command /benchmark in PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jan 6, 2024
1 parent 98e0074 commit cbb94f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/slash-command-dispatch.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -18,6 +22,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
commands: |
benchmark
format
test-gmt-dev
issue-type: pull-request
Expand Down

0 comments on commit cbb94f4

Please sign in to comment.