chore: 配置 GitHub Issue/PR 模板、贡献指南和 CI 工作流 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| backend-lint: | |
| name: Backend Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Run ruff | |
| run: uv run ruff check . | |
| frontend-build: | |
| name: Frontend Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: front | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: front/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| django-check: | |
| name: Django Check | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: DjangoUserService | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Django check | |
| run: uv run python manage.py check --deploy | |
| env: | |
| DJANGO_SETTINGS_MODULE: DjangoUserService.settings | |
| JWT_SECRET_KEY: ci-test-key | |
| DB_ENGINE: django.db.backends.sqlite3 | |
| DB_NAME: db.sqlite3 | |
| CELERY_TASK_ALWAYS_EAGER: "True" |