paper-burner/.github/workflows/ci.yml

40 lines
901 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: CI
on:
push:
branches: [ main, dev/** ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
# 指定锁文件路径以启用 npm 缓存(仓库根部无 lockfile
cache-dependency-path: 'server/package-lock.json'
- name: Install dependencies (server)
working-directory: server
run: npm ci
- name: Lint (server)
working-directory: server
run: npm run lint -- --max-warnings=0
- name: Validate OpenAPI
working-directory: server
run: npm run openapi:validate
- name: Run tests (server)
working-directory: server
env:
NODE_ENV: test
run: npm test -- --ci