74 lines (66 loc) · 2.32 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
name: Benchmark
# Run on push only for master, if not it will trigger push & pull_request on PRs at the same time
on:
push:
branches:
- master
paths-ignore:
# Any update here needs to be done for
# - `pull_request` see below
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/publish/buildkite-entry.sh
- "*.md"
- ".vscode/**"
- "docs/**"
- "examples/**"
- "LICENSE"
- "src/.buildkite/**"
- "src/.dockerignore"
- "src/scripts/ci/publish.ts"
- "src/graphs/**"
env:
PRISMA_TELEMETRY_INFORMATION: "prisma benchmark.yml"
jobs:
benchmark:
name: all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v2
with:
node-version: "12"
- run: bash .github/workflows/setup.sh
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
# This is required as setup.sh can modify pnpm-lock.yml
- run: rm -f src/pnpm-lock.yaml
- run: rm -f ./pnpm-lock.yaml
- name: Run benchmarks
run: pnpm run bench
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Benchmark.js Benchmark
tool: "benchmarkjs"
output-file-path: output.txt
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false
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: "@williamluke4"