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