mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-05 11:10:03 +08:00
enable caching (#9796)
This commit is contained in:
parent
70bda3bb18
commit
421fd5402a
20
.github/actions/install-all-deps/action.yml
vendored
20
.github/actions/install-all-deps/action.yml
vendored
@ -59,20 +59,20 @@ runs:
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
# - uses: actions/cache@v4
|
||||
# id: cache
|
||||
# with:
|
||||
# path: |
|
||||
# venv/*
|
||||
# client/python/venv
|
||||
# restore-keys: |
|
||||
# gradio-lib-${{inputs.python_version}}-${{inputs.os}}-latest-pip-
|
||||
# key: "gradio-lib-${{inputs.python_version}}-${{inputs.os}}-latest-pip-${{ hashFiles('client/python/requirements.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test/requirements.txt') }}-${{ hashFiles('client/python/test/requirements.txt') }}${{ inputs.test == 'true' && '-test' || ''}}"
|
||||
- uses: actions/cache@v4
|
||||
id: cache
|
||||
with:
|
||||
path: |
|
||||
venv/**
|
||||
client/python/venv
|
||||
restore-keys: |
|
||||
gradio-lib-${{inputs.python_version}}-${{inputs.os}}-latest-pip-
|
||||
key: "gradio-lib-${{inputs.python_version}}-${{inputs.os}}-latest-pip-${{ hashFiles('client/python/requirements.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test/requirements.txt') }}-${{ hashFiles('client/python/test/requirements.txt') }}${{ inputs.test == 'true' && '-test' || ''}}"
|
||||
- name: Install ffmpeg
|
||||
uses: FedericoCarboni/setup-ffmpeg@583042d32dd1cabb8bd09df03bde06080da5c87c # @v2
|
||||
- name: Install test dependencies
|
||||
if: inputs.test == 'true'
|
||||
# && steps.cache.outputs.cache-hit != 'true'
|
||||
&& steps.cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
. ${{ env.VENV_ACTIVATE }}
|
||||
|
18
.github/actions/install-frontend-deps/action.yml
vendored
18
.github/actions/install-frontend-deps/action.yml
vendored
@ -12,12 +12,13 @@ inputs:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# - uses: actions/cache@v4
|
||||
# id: frontend-cache
|
||||
# with:
|
||||
# path: |
|
||||
# gradio/templates/*
|
||||
# key: gradio-lib-front-end-${{ hashFiles('js/**', 'client/js/**')}}
|
||||
- uses: actions/cache@v4
|
||||
id: frontend-cache
|
||||
with:
|
||||
path: |
|
||||
gradio/templates/**
|
||||
js/lite/dist/**
|
||||
key: gradio-lib-front-end-${{ hashFiles('js/**', 'client/js/**')}}
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # @v4
|
||||
with:
|
||||
@ -34,8 +35,7 @@ runs:
|
||||
shell: bash
|
||||
run: pnpm css
|
||||
- name: Build frontend
|
||||
if: inputs.skip_build == 'false'
|
||||
# && steps.frontend-cache.outputs.cache-hit != 'true'
|
||||
if: inputs.skip_build == 'false' && steps.frontend-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: pnpm build
|
||||
- name: generate types
|
||||
@ -43,7 +43,7 @@ runs:
|
||||
shell: bash
|
||||
run: pnpm package
|
||||
- name: Build frontend lite
|
||||
if: inputs.build_lite == 'true'
|
||||
if: inputs.build_lite == 'true' && steps.frontend-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
. venv/bin/activate
|
||||
|
Loading…
Reference in New Issue
Block a user