Merge pull request #66 from namtroi/setting #73
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: Lint & Code Quality | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'apps/**' | |
| - 'packages/**' | |
| - 'tests/**' | |
| - '.github/workflows/lint.yml' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - '.eslintrc*' | |
| - 'tsconfig.json' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'apps/**' | |
| - 'packages/**' | |
| - 'tests/**' | |
| - '.github/workflows/lint.yml' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - '.eslintrc*' | |
| - 'tsconfig.json' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| eslint: | |
| name: ESLint (Backend + Frontend) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Prisma Client | |
| run: pnpm --filter @ragbase/backend db:generate | |
| - name: Run ESLint | |
| run: pnpm lint | |
| typescript: | |
| name: TypeScript Type Check | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate Prisma Client | |
| run: pnpm --filter @ragbase/backend db:generate | |
| - name: Type check | |
| run: pnpm type-check | |
| python-lint: | |
| name: Python Lint (Ruff + Black) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && !contains(github.event.head_commit.message, 'Merge pull request')) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install linters | |
| run: | | |
| pip install ruff black | |
| - name: Run Ruff | |
| working-directory: apps/ai-worker | |
| run: ruff check src/ tests/ | |
| - name: Run Black | |
| working-directory: apps/ai-worker | |
| run: black --check src/ tests/ |