393dc941b9a12f03cbbb683cca17155f4a916d99
[poolifier.git] / .github / workflows / benchmark.yml
1 name: Benchmark
2
3 on:
4 workflow_dispatch:
5 push:
6 branches:
7 - master
8
9 permissions:
10 contents: write
11 deployments: write
12
13 jobs:
14 internal-benchmark:
15 if: github.repository == 'poolifier/poolifier'
16 name: Internal benchmark
17 runs-on: [self-hosted, internal-benchmark]
18 steps:
19 - name: Checkout
20 uses: actions/checkout@v4
21 - name: Setup pnpm
22 uses: pnpm/action-setup@v2
23 with:
24 version: 8
25 - name: Setup Node.js
26 uses: actions/setup-node@v3
27 with:
28 node-version: '18.x'
29 cache: 'pnpm'
30 - name: Install dependencies
31 run: pnpm install --ignore-scripts
32 - name: Run production benchmark
33 run: pnpm benchmark:prod | tee ./benchmarks/internal/output.txt
34 - name: Store production benchmark result
35 uses: benchmark-action/github-action-benchmark@v1
36 with:
37 name: Internal benchmark
38 tool: 'benchmarkjs'
39 output-file-path: ./benchmarks/internal/output.txt
40 github-token: ${{ secrets.BENCHMARK_RESULTS_TOKEN }}
41 auto-push: true
42 alert-threshold: '200%'
43 comment-on-alert: true
44 fail-on-alert: true
45 gh-repository: 'github.com/poolifier/benchmark-results'