Prefer using a action to manage commands

This commit is contained in:
Clément Renault 2023-10-09 14:56:41 +02:00
parent 705878ff59
commit ca19bae72f
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -1,15 +1,13 @@
name: Benchmarks (PR) name: Benchmarks (PR)
on: on: issue_comment
issue_comment: permissions:
types: [created, edited] issues: write
env: env:
BENCH_NAME: search_geo
GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }} GH_TOKEN: ${{ secrets.MEILI_BOT_GH_PAT }}
jobs: jobs:
run-benchmarks-on-comment: run-benchmarks-on-comment:
if: contains(github.event.comment.body, '@meilisearch run benchmarks')
name: Run and upload benchmarks name: Run and upload benchmarks
runs-on: benchmarks runs-on: benchmarks
timeout-minutes: 4320 # 72h timeout-minutes: 4320 # 72h
@ -21,6 +19,13 @@ jobs:
toolchain: stable toolchain: stable
override: true override: true
- name: Check for Command
id: command
uses: xt0rted/slash-command-action@v2
with:
command: benchmark
reaction-type: "eyes"
# Set variables # Set variables
- name: Set current branch name - name: Set current branch name
shell: bash shell: bash
@ -36,14 +41,14 @@ jobs:
id: commit_sha id: commit_sha
- name: Set file basename with format "dataset_branch_commitSHA" - name: Set file basename with format "dataset_branch_commitSHA"
shell: bash shell: bash
run: echo "basename=$(echo ${BENCH_NAME}_${{ steps.normalized_current_branch.outputs.name }}_${{ steps.commit_sha.outputs.short }})" >> $GITHUB_OUTPUT run: echo "basename=$(echo ${{ steps.command.outputs.command-arguments }}_${{ steps.normalized_current_branch.outputs.name }}_${{ steps.commit_sha.outputs.short }})" >> $GITHUB_OUTPUT
id: file id: file
# Run benchmarks # Run benchmarks
- name: Run benchmarks - Dataset ${BENCH_NAME} - Branch ${{ steps.current_branch.outputs.name }} - Commit ${{ steps.commit_sha.outputs.short }} - name: Run benchmarks - Dataset ${{ steps.command.outputs.command-arguments }} - Branch ${{ steps.current_branch.outputs.name }} - Commit ${{ steps.commit_sha.outputs.short }}
run: | run: |
cd benchmarks cd benchmarks
cargo bench --bench ${BENCH_NAME} -- --save-baseline ${{ steps.file.outputs.basename }} cargo bench --bench ${{ steps.command.outputs.command-arguments }} -- --save-baseline ${{ steps.file.outputs.basename }}
# Generate critcmp files # Generate critcmp files
- name: Install critcmp - name: Install critcmp