-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
action.yml
51 lines (49 loc) 路 1.55 KB
/
action.yml
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
name: 'install frontend'
description: 'Install frontend deps'
inputs:
always_install_pnpm:
description: 'Dictates whether or not we should install pnpm & dependencies, regardless of the cache'
default: 'false'
skip_build:
description: 'Skip build'
default: 'false'
build_lite:
description: 'Build lite'
default: 'false'
runs:
using: "composite"
steps:
- uses: actions/cache@v4
id: frontend-cache
with:
path: |
gradio/templates/*
key: gradio-lib-front-end-${{ hashFiles('js/**', 'client/js/**')}}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 9.1.x
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install deps
if: steps.frontend-cache.outputs.cache-hit != 'true' || inputs.always_install_pnpm == 'true'
shell: bash
run: pnpm i --frozen-lockfile --ignore-scripts
- name: Build Css
if: inputs.always_install_pnpm == 'true'
shell: bash
run: pnpm css
- name: Build frontend
if: inputs.skip_build == 'false' && steps.frontend-cache.outputs.cache-hit != 'true'
shell: bash
run: pnpm build
- name: Build frontend lite
if: inputs.build_lite == 'true'
shell: bash
run: |
. venv/bin/activate
python -m pip install -U build hatch packaging>=23.2 # packaging>=23.2 is needed to build Lite due to https://github.com/pypa/hatch/issues/1381
pnpm --filter @gradio/app build:lite