ci: add web frontend lint and type check workflow (#2444)
Add a dedicated GitHub Actions workflow for the Next.js web frontend that runs on changes to the web/ directory: - ESLint checks via 'npm run lint' - TypeScript type checking via 'tsc --noEmit' - Runs on push to main and PRs targeting main - Uses npm cache for faster dependency installation Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
name: Web Frontend
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master, main]
|
||||||
|
paths:
|
||||||
|
- 'web/**'
|
||||||
|
pull_request:
|
||||||
|
branches: [master, main]
|
||||||
|
paths:
|
||||||
|
- 'web/**'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint & Type Check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: web
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: web/package-lock.json
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
- name: Run ESLint
|
||||||
|
run: npm run lint
|
||||||
|
- name: TypeScript type check
|
||||||
|
run: npx tsc --noEmit
|
||||||
Reference in New Issue
Block a user