Skip to content

Commit 2eed75c

Browse files
tatomyrDmitryAnansky
authored andcommitted
improve perf. benchmark
1 parent 9769dcb commit 2eed75c

2 files changed

Lines changed: 9 additions & 39 deletions

File tree

.github/workflows/performance.yaml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,6 @@ env:
1414
REDOCLY_TELEMETRY: off
1515

1616
jobs:
17-
# latest-vs-next:
18-
# # Do not run on the release branch (changeset-release/main):
19-
# if: github.head_ref != 'changeset-release/main'
20-
# runs-on: ubuntu-latest
21-
# steps:
22-
# - uses: actions/checkout@v4
23-
# - uses: actions/setup-node@v3
24-
# with:
25-
# node-version: 24
26-
# cache: npm
27-
# - name: Install Dependencies
28-
# run: npm ci
29-
# - name: Install External
30-
# run: npm i -g hyperfine
31-
# - name: Prepare
32-
# run: |
33-
# npm run compile
34-
# npm run pack:prepare
35-
# cd tests/performance/
36-
# npm i
37-
# npm run make-test
38-
39-
# - name: Run Benchmark
40-
# run: |
41-
# cd tests/performance/
42-
# npm run compare_latest_vs_next
43-
# cat benchmark_check.md
44-
# npm run chart # Creates benchmark_chart.md with the performance bar chart.
45-
46-
# - name: Comment PR
47-
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
48-
# uses: thollander/actions-comment-pull-request@v2
49-
# with:
50-
# filePath: tests/performance/benchmark_chart.md
51-
# comment_tag: latest-vs-next-comparison
52-
5317
historical-versions:
5418
runs-on: ubuntu-latest
5519
steps:
@@ -65,7 +29,7 @@ jobs:
6529

6630
- name: Add more versions to test
6731
# Run only on the release branch (changeset-release/main):
68-
if: github.head_ref != 'changeset-release/main'
32+
if: github.head_ref == 'changeset-release/main'
6933
run: |
7034
cd tests/performance/
7135
cat package.json | jq ".dependencies = $(cat package.json | jq ._enhancedDependencies)" > package.json

CONTRIBUTING.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,16 @@ For other commands you'd have to do something similar.
286286
### Performance benchmark
287287

288288
To run the performance tests locally, you should have `hyperfine` (v1.16.1+) installed on your machine.
289-
Prepare the local build, go to the `tests/performance` folder, clean it up, do the preparations, and run the actual test:
289+
Prepare the local build, go to the `tests/performance` folder, clean it up, do the preparations:
290290

291291
```sh
292-
(npm run compile && npm run pack:prepare && cd tests/performance/ && git clean -dX -f . && git clean -dX -ff . && npm i && npm run make-test && npm test)
292+
(npm run compile && npm run pack:prepare && cd tests/performance/ && git clean -dX -f . && git clean -dX -ff . && rm -rf node_modules && rm -f package-lock.json && npm i && npm run make-test)
293+
```
294+
295+
and run the actual test:
296+
297+
```sh
298+
(cd tests/performance/ && npm run test && cat benchmark_check.md)
293299
```
294300

295301
You might need to adjust the CLI versions that need to be tested in the `tests/performance/package.json` file.

0 commit comments

Comments
 (0)