name: CI # Lance lint + typecheck + tests + build sur push/PR. # # Workflow dormant tant qu'aucun runner Forgejo n'est enregistré. # Pour activer : # 1) Sur git.cosmolan.fr, générer un token runner : # Admin → Actions → Runners → Create new Runner Token # (ou pour ce repo seul : Settings → Actions → Runners → Create) # 2) Sur la machine d'exécution : # wget https://codeberg.org/forgejo/runner/releases/download/v6.7.0/forgejo-runner-6.7.0-linux-amd64 # chmod +x forgejo-runner-6.7.0-linux-amd64 # ./forgejo-runner-6.7.0-linux-amd64 register \ # --instance https://git.cosmolan.fr \ # --token \ # --name karbe-ci \ # --labels "ubuntu-latest:docker://node:20" # 3) Démarrer : # ./forgejo-runner-6.7.0-linux-amd64 daemon on: push: branches: [main] pull_request: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "20" cache: "npm" - name: Install dependencies run: npm ci --no-audit --no-fund - name: Generate Prisma client run: npx prisma generate - name: Lint run: npm run lint - name: Typecheck run: npm run typecheck - name: Test run: npm test - name: Build (smoke) run: npm run build env: # Stubs nécessaires au build statique — pas de connexion réelle. DATABASE_URL: "postgresql://stub:stub@localhost:5432/stub?schema=public" NEXTAUTH_SECRET: "ci-secret-not-for-production" AUTH_SECRET: "ci-secret-not-for-production" NEXT_PUBLIC_SITE_URL: "https://example.invalid"