name: Dev CI # Fast feedback loop for the dev branch. # Runs lint + unit tests only — no Docker build, no deployment. on: push: branches: [dev] pull_request: branches: [dev] concurrency: group: dev-ci-${{ github.ref }} cancel-in-progress: true env: NODE_VERSION: '20' jobs: # ────────────────────────────────────────── # Lint & Type-check # ────────────────────────────────────────── quality: name: Quality (${{ matrix.app }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: app: [backend, frontend] defaults: run: working-directory: apps/${{ matrix.app }} steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' cache-dependency-path: apps/${{ matrix.app }}/package-lock.json - name: Install dependencies run: npm ci --legacy-peer-deps - name: Lint run: npm run lint - name: Type-check (frontend only) if: matrix.app == 'frontend' run: npm run type-check # ────────────────────────────────────────── # Unit Tests # ────────────────────────────────────────── unit-tests: name: Unit Tests (${{ matrix.app }}) runs-on: ubuntu-latest needs: quality strategy: fail-fast: false matrix: app: [backend, frontend] defaults: run: working-directory: apps/${{ matrix.app }} steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' cache-dependency-path: apps/${{ matrix.app }}/package-lock.json - name: Install dependencies run: npm ci --legacy-peer-deps - name: Run unit tests run: npm test -- --passWithNoTests --coverage # ────────────────────────────────────────── # Discord notification on failure # ────────────────────────────────────────── notify-failure: name: Notify Failure runs-on: ubuntu-latest needs: [quality, unit-tests] if: failure() steps: - name: Send Discord notification run: | curl -s -H "Content-Type: application/json" -d '{ "embeds": [{ "title": "❌ Dev CI Failed", "description": "Fix the issues before merging to preprod.", "color": 15158332, "fields": [ {"name": "Branch", "value": "`${{ github.ref_name }}`", "inline": true}, {"name": "Author", "value": "${{ github.actor }}", "inline": true}, {"name": "Commit", "value": "[`${{ github.sha }}`](${{ github.event.head_commit.url }})", "inline": false}, {"name": "Workflow", "value": "[${{ github.workflow }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})", "inline": false} ], "footer": {"text": "Xpeditis CI/CD"} }] }' ${{ secrets.DISCORD_WEBHOOK_URL }}