[pull] main from prisma:main #2379
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Benchmark | |
# Run on `push` only for main, if not it will trigger `push` & `pull_request` on PRs at the same time | |
on: | |
push: | |
branches: | |
- main | |
- '*.*.x' | |
paths-ignore: | |
# Any update here needs to be done for `pull_request`, see below | |
# and all files (test.yml, benchmark.yml, release-ci.yml, bundle-size.yml) | |
- '*.md' | |
# - '*.bench.ts' -> should not be ignored in this workflow | |
- 'LICENSE' | |
- '.dockerignore' | |
- 'scripts/ci/publish.ts' | |
- '.github/CODEOWNERS' | |
- '.github/renovate.json' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/DISCUSSION_TEMPLATE/**' | |
- '.devcontainer/**' | |
- '.vscode/**' | |
- 'graphs/**' | |
- 'sandbox/**' | |
pull_request: | |
paths-ignore: | |
# Any update here needs to be done for `push`, see above | |
# and all files (test.yml, benchmark.yml, release-ci.yml) | |
- '*.md' | |
# - '*.bench.ts' -> should not be ignored in this workflow | |
- 'LICENSE' | |
- '.dockerignore' | |
- 'scripts/ci/publish.ts' | |
- '.github/CODEOWNERS' | |
- '.github/renovate.json' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/DISCUSSION_TEMPLATE/**' | |
- '.devcontainer/**' | |
- '.vscode/**' | |
- 'graphs/**' | |
- 'sandbox/**' | |
workflow_dispatch: | |
env: | |
PRISMA_TELEMETRY_INFORMATION: 'prisma benchmark.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
benchmark: | |
name: Benchmark | |
runs-on: ubuntu-latest | |
# Only run on main repo (not on forks) | |
# This avoids notifications to be sent to `alert-comment-cc-users`, see below | |
if: github.repository == 'prisma/prisma' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install & build | |
uses: ./.github/actions/setup | |
with: | |
node-version: 20 | |
pnpm-version: 8.15.5 | |
skip-tsc: false | |
- name: Run benchmarks | |
run: pnpm run bench | |
- name: Store benchmark result | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: rhysd/github-action-benchmark@v1 | |
with: | |
name: Benchmark.js Benchmark | |
tool: 'benchmarkjs' | |
output-file-path: output.txt | |
# Note: must use personal access token | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
auto-push: true | |
# Show alert with commit comment on detecting possible performance regression | |
alert-threshold: '200%' | |
comment-on-alert: true | |
fail-on-alert: true | |
alert-comment-cc-users: '@millsp,@aqrln,@SevInf,@jkomyno' | |
- name: Run benchmarks for Codspeed | |
uses: CodSpeedHQ/action@v2 | |
with: | |
run: pnpm run bench-stdout-only | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
env: | |
CODSPEED_BENCHMARK: true | |
- name: 'Set current job url in SLACK_FOOTER env var' | |
if: ${{ failure() && github.ref == 'refs/heads/main' }} | |
run: echo "SLACK_FOOTER=<$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|Click here to go to the job logs>" >> "$GITHUB_ENV" | |
- name: Slack Notification on Failure | |
if: ${{ failure() && github.ref == 'refs/heads/main' }} | |
uses: rtCamp/action-slack-notify@v2.3.0 | |
env: | |
SLACK_TITLE: 'Benchmark failed :x:' | |
SLACK_COLOR: '#FF0000' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: feed-prisma-failures | |
SLACK_USERNAME: Prismo | |
SLACK_ICON_EMOJI: ':boom:' | |
SLACK_MSG_AUTHOR: prisma-bot |