@@ -33,35 +33,57 @@ jobs:
3333 id : latest_tag
3434 run : echo "tag=$(git tag --list 'gradio@*' --sort=-v:refname | head -n 1)" >> "$GITHUB_OUTPUT"
3535
36- - name : Restore base benchmark cache
36+ - name : Setup Python
3737 if : steps.changes.outputs.should_run == 'true'
38- id : base_cache
39- uses : actions/cache@v4
38+ uses : actions/setup-python@v5
39+ with :
40+ python-version : " 3.10"
41+
42+ - name : Install uv
43+ if : steps.changes.outputs.should_run == 'true'
44+ run : curl -LsSf https://astral.sh/uv/0.9.2/install.sh | sh
45+
46+ - name : Install pnpm
47+ if : steps.changes.outputs.should_run == 'true'
48+ uses : pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # @v4
4049 with :
41- path : /tmp/bench_base.json
42- key : frontend-bench-base-${{ steps.latest_tag.outputs.tag }}
50+ version : 10.17.0
51+
52+ - name : Setup Node.js
53+ if : steps.changes.outputs.should_run == 'true'
54+ uses : actions/setup-node@v4
55+ with :
56+ node-version : 24
57+ cache : pnpm
58+ cache-dependency-path : pnpm-lock.yaml
4359
4460 - name : Checkout latest release
45- if : steps.changes.outputs.should_run == 'true' && steps.base_cache.outputs.cache-hit != 'true'
61+ if : steps.changes.outputs.should_run == 'true'
4662 run : git checkout ${{ steps.latest_tag.outputs.tag }}
4763
48- - name : Install dependencies
49- if : steps.changes.outputs.should_run == 'true' && steps.base_cache.outputs.cache-hit != 'true'
50- uses : " gradio-app/gradio/.github/actions/install-all-deps@main"
51- with :
52- python_version : " 3.10"
53- os : " ubuntu-latest"
64+ - name : Create venv and install Python deps (base)
65+ if : steps.changes.outputs.should_run == 'true'
66+ run : |
67+ export PATH="$HOME/.cargo/bin:$PATH"
68+ uv venv venv --python=3.10
69+ . venv/bin/activate
70+ uv pip install -e client/python
71+ uv pip install -e ".[oauth,mcp]"
72+
73+ - name : Install frontend deps and build (base)
74+ if : steps.changes.outputs.should_run == 'true'
75+ run : pnpm i --frozen-lockfile --ignore-scripts && pnpm css && pnpm build
5476
5577 - name : Install Playwright (base)
56- if : steps.changes.outputs.should_run == 'true' && steps.base_cache.outputs.cache-hit != 'true'
78+ if : steps.changes.outputs.should_run == 'true'
5779 run : pnpm exec playwright install chromium
5880
5981 - name : Checkout benchmark spec and demo from PR
60- if : steps.changes.outputs.should_run == 'true' && steps.base_cache.outputs.cache-hit != 'true'
82+ if : steps.changes.outputs.should_run == 'true'
6183 run : git checkout ${{ github.event.pull_request.head.sha }} -- js/spa/test/big_complex_demo.spec.ts demo/big_complex_demo
6284
6385 - name : Run benchmark (base)
64- if : steps.changes.outputs.should_run == 'true' && steps.base_cache.outputs.cache-hit != 'true'
86+ if : steps.changes.outputs.should_run == 'true'
6587 run : |
6688 . venv/bin/activate
6789 PERF_RESULTS_FILE=/tmp/bench_base.json pnpm exec playwright test \
@@ -74,36 +96,16 @@ jobs:
7496 git clean -fd
7597 git checkout -f ${{ github.event.pull_request.head.sha }}
7698
77- - name : Setup Python (PR)
78- if : steps.changes.outputs.should_run == 'true'
79- uses : actions/setup-python@v5
80- with :
81- python-version : " 3.10"
82-
83- - name : Install pnpm (PR)
84- if : steps.changes.outputs.should_run == 'true'
85- uses : pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # @v4
86- with :
87- version : 10.17.0
88-
89- - name : Setup Node.js (PR)
90- if : steps.changes.outputs.should_run == 'true'
91- uses : actions/setup-node@v4
92- with :
93- node-version : 24
94- cache : pnpm
95- cache-dependency-path : pnpm-lock.yaml
96-
9799 - name : Install and build PR
98100 if : steps.changes.outputs.should_run == 'true'
99101 run : |
100- command -v uv >/dev/null 2>&1 || { curl -LsSf https://astral.sh/uv/0.9.2/install.sh | sh && export PATH="$HOME/.cargo/bin:$PATH"; }
102+ export PATH="$HOME/.cargo/bin:$PATH"
101103 uv venv venv --python=3.10
102104 . venv/bin/activate
103105 uv pip install -e client/python
104106 uv pip install -e ".[oauth,mcp]"
105107 pnpm install --no-frozen-lockfile
106- pnpm build
108+ pnpm css && pnpm build
107109
108110 - name : Install Playwright (PR)
109111 if : steps.changes.outputs.should_run == 'true'
0 commit comments