Skip to content

Benchmark-Baseline

Benchmark-Baseline #4

name: Benchmark-Baseline
on:
workflow_dispatch:
concurrency:
group: 'workflow-${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Install and execute benchmark
uses: ./.github/actions/benchmark
- name: Remove husky
run: rm -rf .husky
shell: bash
- name: Copy result as new baseline
run: cp packages/tools/benchmark-tests/benchmark-result.json packages/tools/benchmark-tests/benchmark-baseline.json
- name: Commit and push updated baseline
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: update benchmark-baseline.json [ci skip]'
file_pattern: 'packages/tools/benchmark-tests/benchmark-baseline.json'
commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]'
commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'