Skip to content

Commit

Permalink
chore: Fix benchmark file path, run benchmark on PRs (#14220)
Browse files Browse the repository at this point in the history
Run benchmark on PR, but skip publishing and notifications
  • Loading branch information
SevInf committed Jul 8, 2022
1 parent 8d99655 commit 135d769
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/benchmark.yml
@@ -1,5 +1,4 @@
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:
Expand All @@ -20,6 +19,19 @@ on:
- '.dockerignore'
- 'scripts/ci/publish.ts'
- 'graphs/**'
pull_request:
paths-ignore:
- '*.md'
- '.devcontainer/**'
- '.vscode/**'
- 'docs/**'
- 'examples/**'
- 'LICENSE'
- '.github/CODEOWNERS'
- 'src/.buildkite/**'
- '.dockerignore'
- 'scripts/ci/publish.ts'
- 'graphs/**'

env:
PRISMA_TELEMETRY_INFORMATION: 'prisma benchmark.yml'
Expand Down Expand Up @@ -53,6 +65,7 @@ jobs:
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
Expand All @@ -68,11 +81,11 @@ jobs:
alert-comment-cc-users: '@Jolg42,@millsp,@aqrln,@SevInf,@danstarns,@jkomyno'

- name: 'Set current job url in SLACK_FOOTER env var'
if: ${{ failure() }}
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() }}
if: ${{ failure() && github.ref == 'refs/heads/main' }}
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_TITLE: 'Benchmark failed :x:'
Expand Down
Expand Up @@ -48,7 +48,7 @@ suite
printSize('./node_modules/.prisma/client/index.js')
// For GitHub CI
if (process.env.CI) {
printSize('./node_modules/.prisma/client/query-engine-debian-openssl-1.1.x')
printSize('./node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node')
}
execa.sync('rm', ['-rf', `./dotPlusAtPrismaClientFolder.zip`], {
stdout: 'pipe',
Expand Down

0 comments on commit 135d769

Please sign in to comment.