Skip to content

Commit 5f6d507

Browse files
chore: Faster npm pre-commit (#3206)
# What does this PR do? Adds npm to pre-commit.yml installation and caches ui Removes node installation during pre-commit. <!-- If resolving an issue, uncomment and update the line below --> <!-- Closes #[issue-number] --> ## Test Plan <!-- Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.* --> Signed-off-by: Francisco Javier Arceo <[email protected]>
1 parent 7f0b2a8 commit 5f6d507

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/pre-commit.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ jobs:
3636
**/requirements*.txt
3737
.pre-commit-config.yaml
3838
39+
- name: Set up Node.js
40+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
41+
with:
42+
node-version: '20'
43+
cache: 'npm'
44+
cache-dependency-path: 'llama_stack/ui/'
45+
46+
- name: Install npm dependencies
47+
run: npm ci
48+
working-directory: llama_stack/ui
49+
3950
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
4051
continue-on-error: true
4152
env:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ repos:
155155
require_serial: true
156156
- id: ui-eslint
157157
name: Lint UI code with ESLint
158-
entry: bash -c 'cd llama_stack/ui && npm ci && npm run lint -- --fix --quiet'
158+
entry: bash -c 'cd llama_stack/ui && npm run lint -- --fix --quiet'
159159
language: system
160160
files: ^llama_stack/ui/.*\.(ts|tsx)$
161161
pass_filenames: false

0 commit comments

Comments
 (0)