ci: enable vite task cache

This commit is contained in:
Stephen Zhou
2026-03-31 11:07:44 +08:00
parent 7e4754392d
commit f833701a4a
3 changed files with 11 additions and 3 deletions

View File

@@ -1,10 +1,11 @@
name: Setup Web Environment
description: A GitHub Action to set up the web environment using Vite+.
runs:
using: composite
steps:
- name: Setup Vite+
uses: voidzero-dev/setup-vp@20553a7a7429c429a74894104a2835d7fed28a72 # v1.3.0
uses: hyoban/setup-vp@96511aa421048609564ade4427c73d0078d4afc1 # v1.3.0
with:
node-version-file: .nvmrc
cache: true

View File

@@ -106,12 +106,12 @@ jobs:
- name: Web tsslint
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: ./web
run: vp run lint:tss
run: vp run lint:tss --cache
- name: Web type check
if: steps.changed-files.outputs.any_changed == 'true'
working-directory: ./web
run: vp run type-check
run: vp run type-check --cache
- name: Web dead code check
if: steps.changed-files.outputs.any_changed == 'true'

View File

@@ -84,5 +84,12 @@ export default defineConfig(({ mode }) => {
reporter: isCI ? ['json', 'json-summary'] : ['text', 'json', 'json-summary'],
},
},
tasks: {
'type-check': {
command: 'tsc --noEmit',
input: [{ auto: true }, '!**/*.tsbuildinfo'],
},
},
}
})