Repository navigation
161 lines (141 loc) ยท 5.14 KB
/
Copy pathperformance.yml
File metadata and controls
161 lines (141 loc) ยท 5.14 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: performance-tests
permissions:
contents: read
on:
push:
branches:
- "main" # or "master"
paths-ignore:
- "**/*.md"
pull_request:
workflow_dispatch:
env:
REFLEX_TELEMETRY_ENABLED: false
NODE_OPTIONS: "--max_old_space_size=8192"
APP_HARNESS_HEADLESS: 1
PYTHONUNBUFFERED: 1
# Randomized string hashing shifts dict probe sequences run to run, which the
# instrumented benchmarks can pick up as drift unrelated to the code change.
PYTHONHASHSEED: 0
jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
env:
REFLEX_CLI_BENCHMARK_TIMEOUT_SECONDS: "120"
timeout-minutes: 60
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-tags: true
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Run benchmarks
uses: CodSpeedHQ/action@373d6868929f444bc08d901fd0eb0ad52a8875ea # v5.2.1
with:
mode: simulation
simulation-track-subprocess: true
# Callgrind can segfault when profiling state benchmarks after the
# repeated-page workloads. Give compilation its own interpreter.
run: |
set -e
uv run pytest -v tests/benchmarks/test_compilation.py tests/benchmarks/test_evaluate.py --codspeed
uv run pytest -v tests/benchmarks --ignore=tests/benchmarks/test_compilation.py --ignore=tests/benchmarks/test_evaluate.py --codspeed
- name: Run event-loop and wire-size smoke
run: >-
uv run pytest tests/performance/test_event_loop.py tests/performance/test_wire_size.py
--run-performance
--performance-scale smoke
--performance-output .pytest-tmp/performance
-q
- name: Upload performance smoke results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: performance-smoke-benchmarks
path: .pytest-tmp/performance/**
if-no-files-found: ignore
browser-performance:
name: Run browser performance smoke
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-tags: true
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/setup_build_env
with:
python-version: "3.14"
run-uv-sync: true
- name: Install playwright
run: uv run playwright install chromium --only-shell
- name: Run browser performance smoke and bundle budget
run: >-
uv run pytest tests/performance/test_browser.py
--run-performance
--performance-scale smoke
--performance-output .pytest-tmp/performance
-q
- name: Upload performance smoke results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: performance-smoke-browser
path: .pytest-tmp/performance/**
if-no-files-found: ignore
lighthouse:
name: Run Lighthouse benchmark
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-tags: true
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/setup_build_env
with:
python-version: "3.14"
run-uv-sync: true
- name: Install playwright
run: uv run playwright install chromium --only-shell
- name: Run Lighthouse benchmark
env:
REFLEX_RUN_LIGHTHOUSE: "1"
run: |
mkdir -p .pytest-tmp/lighthouse
uv run pytest tests/integration/test_lighthouse.py -q -s --tb=no --basetemp=.pytest-tmp/lighthouse
- name: Upload Lighthouse artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: lighthouse-report
path: |
.pytest-tmp/lighthouse/**
!.pytest-tmp/lighthouse/*current
!.pytest-tmp/lighthouse/*current/**
if-no-files-found: ignore
# The one status check the branch rules require from this workflow. Naming the
# jobs above directly does not survive: check names follow the matrix and the
# display names, and a job that a filter skips must not block the merge.
performance-tests-gate:
needs: [benchmarks, browser-performance, lighthouse]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: ./.github/actions/ci_gate
with:
needs: ${{ toJSON(needs) }}