-
Notifications
You must be signed in to change notification settings - Fork 158
79 lines (74 loc) · 2.56 KB
/
performance.yaml
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
name: Performance Benchmark
on:
pull_request:
branches:
- main
jobs:
latest-vs-next:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Install External
run: npm i -g hyperfine @redocly/cli@latest
- name: Prepare
run: |
jq '.bin = {"redocly-next":"bin/cli.js"} | .name = "@redocly/cli-next"' packages/cli/package.json > __tmp__.json
mv __tmp__.json packages/cli/package.json
cat packages/cli/package.json
npm run pack:prepare
npm i -g redocly-cli.tgz
- run: redocly-next --version
- run: redocly --version
- name: Run Benchmark
run: hyperfine -i --warmup 3 'redocly lint packages/core/src/benchmark/benches/rebilly.yaml' 'redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml' --export-markdown benchmark_check.md --export-json benchmark_check.json
env:
CI: true
REDOCLY_TELEMETRY: off
- name: Comment PR
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: benchmark_check.md
comment_tag: latest-vs-next-comparison
historical-versions:
# Run only on release branch (changeset-release/main):
if: github.head_ref == 'changeset-release/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Install External
run: npm i -g hyperfine
- name: Prepare
run: |
npm run compile
npm run pack:prepare
cd benchmark/
npm i
npm run make-test
- name: Run Benchmark
run: |
cd benchmark/
npm test # This command is generated and injected into package.json in the previous step.
cat benchmark_check.md
npm run chart # Creates benchmark_chart.md with the performance bar chart.
env:
CI: true
REDOCLY_TELEMETRY: off
- name: Comment PR
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: benchmark/benchmark_chart.md
comment_tag: historical-versions-comparison