61e1023b3a
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>
36 lines
691 B
YAML
36 lines
691 B
YAML
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
|