Some checks failed
CD Preprod / Unit Tests (${{ matrix.app }}) (backend) (push) Blocked by required conditions
CD Preprod / Unit Tests (${{ matrix.app }}) (frontend) (push) Blocked by required conditions
CD Preprod / Integration Tests (push) Blocked by required conditions
CD Preprod / Build & Push Backend (push) Blocked by required conditions
CD Preprod / Build & Push Frontend (push) Blocked by required conditions
CD Preprod / Deploy to Preprod (push) Blocked by required conditions
CD Preprod / Smoke Tests (push) Blocked by required conditions
CD Preprod / Deployment Summary (push) Blocked by required conditions
CD Preprod / Notify Success (push) Blocked by required conditions
CD Preprod / Notify Failure (push) Blocked by required conditions
CD Preprod / Quality (${{ matrix.app }}) (backend) (push) Has been cancelled
CD Preprod / Quality (${{ matrix.app }}) (frontend) (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
113 lines
3.6 KiB
YAML
113 lines
3.6 KiB
YAML
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 }}
|