Feature/ai model training #10
Workflow file for this run
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: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-and-type-check: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: 8 | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run ESLint | |
| run: pnpm lint || echo "ESLint found issues but continuing..." | |
| continue-on-error: true | |
| - name: Type check | |
| run: pnpm tsc --noEmit || echo "TypeScript check found issues but continuing..." | |
| continue-on-error: true | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: lint-and-type-check | |
| steps: | |
| - name: Checkout code | |
| 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: 8 | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Create .env.local for build | |
| run: | | |
| cat > .env.local << EOF | |
| NEXT_PUBLIC_SUPABASE_URL=https://placeholder.supabase.co | |
| NEXT_PUBLIC_SUPABASE_ANON_KEY=placeholder-key | |
| OLLAMA_URL=http://localhost:11434 | |
| OLLAMA_MODEL=deepseek-r1:7b | |
| EOF | |
| - name: Build Next.js app | |
| run: pnpm build | |
| env: | |
| NEXT_PUBLIC_SUPABASE_URL: https://placeholder.supabase.co | |
| NEXT_PUBLIC_SUPABASE_ANON_KEY: placeholder-key | |
| check-format: | |
| name: Check Code Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: 8 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check formatting (if prettier is configured) | |
| run: | | |
| if command -v prettier &> /dev/null; then | |
| echo "Prettier found, checking formatting..." | |
| pnpm prettier --check . || echo "Formatting issues found but continuing..." | |
| else | |
| echo "Prettier not installed, skipping format check" | |
| fi | |
| shell: bash | |
| continue-on-error: true | |
| security-scan: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| 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: 8 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run security audit | |
| run: pnpm audit --audit-level=high | |
| continue-on-error: true | |
| status-check: | |
| name: All Checks Passed | |
| runs-on: ubuntu-latest | |
| needs: [lint-and-type-check, build, check-format, security-scan] | |
| if: always() | |
| steps: | |
| - name: Check status | |
| run: | | |
| echo "Lint and Type Check: ${{ needs.lint-and-type-check.result }}" | |
| echo "Build: ${{ needs.build.result }}" | |
| echo "Check Format: ${{ needs.check-format.result }}" | |
| echo "Security Scan: ${{ needs.security-scan.result }}" | |
| if [ "${{ needs.build.result }}" != "success" ]; then | |
| echo "Build failed! This is required." | |
| exit 1 | |
| fi | |
| if [ "${{ needs.lint-and-type-check.result }}" != "success" ]; then | |
| echo "Lint/Type check had issues (non-blocking)" | |
| fi | |
| echo "All required checks passed!" |