forked from prisma/prisma
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (99 loc) · 3.52 KB
/
benchmark.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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, ci-aux-files.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 `branches` (see above) and all files
# (test.yml, benchmark.yml, release-ci.yml, bundle-size.yml, ci-aux-files.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: 9
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@v3
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/[email protected]
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