Skip to content

Commit 9f89e31

Browse files
authored
[core] Test charts performance with codspeed (#13952)
1 parent acfcb3b commit 9f89e31

11 files changed

+1405
-79
lines changed

.github/workflows/codspeed.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
- 'next'
8+
paths:
9+
- 'packages/x-charts*/**'
10+
pull_request:
11+
types:
12+
- labeled
13+
- opened
14+
- synchronize
15+
- reopened
16+
branches:
17+
- 'master'
18+
- 'next'
19+
20+
jobs:
21+
benchmarks:
22+
name: Benchmarks Charts
23+
runs-on: ubuntu-latest
24+
# L1: Run the benchmarks for pushes to the master or next branch and if the changes are in the charts package based on on.push.paths
25+
# L2: Run the benchmarks if we add the label 'component: charts' to the pull request
26+
# L3: Run the benchmarks for pull requests with the label 'component: charts'
27+
if: >
28+
"
29+
${{ github.event_name == 'push' }} ||
30+
${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'component: charts' }} ||
31+
${{ github.event_name == 'pull_request' && github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'component: charts')}}
32+
"
33+
steps:
34+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
35+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
36+
with:
37+
run_install: false
38+
- name: Use Node.js 20.x
39+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
40+
with:
41+
node-version: 20
42+
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
43+
- run: pnpm install --frozen-lockfile
44+
# Ensure we are running on the prod version of our libs
45+
# Only charts and license are needed for the benchmarks
46+
- run: pnpm --filter @mui/x-license build
47+
- run: pnpm --filter @mui/x-charts build
48+
- run: pnpm --filter @mui/x-charts-pro build
49+
- name: Run benchmarks
50+
uses: CodSpeedHQ/action@a58b84c0b61569a9cbb7cfb378cc849d65cf1ce5
51+
with:
52+
run: pnpm --filter @mui-x-internal/performance-charts test:performance
53+
token: ${{ secrets.CODSPEED_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ performance-snapshot.json
2525
.github/styles/Google
2626
.github/styles/MUI
2727
.github/styles/.vale-config
28+
test-results

0 commit comments

Comments
 (0)