1f1bf80ed9b547343aa40126b9053443618da6e3
[poolifier.git] / .github / workflows / external-benchmark.yml
1 name: External benchmark
2
3 on:
4 workflow_dispatch:
5 schedule:
6 - cron: '0 3 * * *'
7
8 jobs:
9 external-benchmark:
10 if: github.repository == 'poolifier/poolifier'
11 name: External benchmark
12 runs-on: [self-hosted, external-benchmark]
13 defaults:
14 run:
15 working-directory: benchmarks/versus-external-pools
16 steps:
17 - name: Checkout
18 uses: actions/checkout@v4
19 - name: Setup pnpm
20 uses: pnpm/action-setup@v2
21 with:
22 version: 8
23 - name: Setup Node.js
24 uses: actions/setup-node@v3
25 with:
26 node-version: '18.x'
27 cache: 'pnpm'
28 - name: Install dependencies
29 run: pnpm install --ignore-scripts
30 - name: Run benchmark
31 if: github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
32 run: ./bench.sh
33 - name: Commit files
34 if: github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
35 env:
36 COMMIT_MESSAGE: 'docs: update benchmark versus external pools results'
37 COMMIT_AUTHOR: Benchmark Bot
38 COMMIT_EMAIL: benchmark-bot@users.noreply.github.com
39 run: |
40 git config --local user.name "${{ env.COMMIT_AUTHOR }}"
41 git config --local user.email "${{ env.COMMIT_EMAIL }}"
42 git commit -a -m "${{ env.COMMIT_MESSAGE }}"
43 - name: Push changes
44 if: github.ref == 'refs/heads/${{ github.event.repository.default_branch }}'
45 uses: CasperWA/push-protected@v2
46 with:
47 token: ${{ secrets.GH_TOKEN_PROTECTED }}
48 branch: ${{ github.event.repository.default_branch }}