|
7 | 7 | branches: [ main ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build_test_lint: |
11 | | - name: Build, Test, and Lint |
| 10 | + # ── 1. Detección de Cambios ──────────────────────────────────────────────── |
| 11 | + changes: |
12 | 12 | runs-on: ubuntu-latest |
13 | | - |
| 13 | + outputs: |
| 14 | + lib: ${{ steps.filter.outputs.lib }} |
| 15 | + demo: ${{ steps.filter.outputs.demo }} |
14 | 16 | steps: |
15 | | - - name: Checkout repository |
16 | | - uses: actions/checkout@v4 |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: dorny/paths-filter@v3 |
| 19 | + id: filter |
| 20 | + with: |
| 21 | + filters: | |
| 22 | + lib: |
| 23 | + - 'projects/ngx-theme-stack/**' |
| 24 | + - 'package.json' |
| 25 | + - 'pnpm-lock.yaml' |
| 26 | + demo: |
| 27 | + - 'projects/demo-ngx-theme-stack/**' |
| 28 | + - 'package.json' |
| 29 | + - 'pnpm-lock.yaml' |
17 | 30 |
|
18 | | - - name: Install pnpm |
19 | | - uses: pnpm/action-setup@v4 |
| 31 | + # ── 2. Job para la Librería ──────────────────────────────────────────────── |
| 32 | + library: |
| 33 | + needs: changes |
| 34 | + if: ${{ needs.changes.outputs.lib == 'true' }} |
| 35 | + name: Test & Build Library |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - uses: pnpm/action-setup@v4 |
20 | 40 | with: |
21 | 41 | version: 10.30.3 |
22 | | - |
23 | | - - name: Setup Node.js |
24 | | - uses: actions/setup-node@v4 |
| 42 | + - uses: actions/setup-node@v4 |
25 | 43 | with: |
26 | 44 | node-version: '20' |
27 | 45 | cache: 'pnpm' |
|
37 | 55 |
|
38 | 56 | - name: Build Library |
39 | 57 | run: pnpm exec ng build ngx-theme-stack |
| 58 | + |
| 59 | + # ── 3. Job para la Demo ─────────────────────────────────────────────────── |
| 60 | + demo: |
| 61 | + needs: changes |
| 62 | + if: ${{ needs.changes.outputs.demo == 'true' }} |
| 63 | + name: Build Demo App |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v4 |
| 67 | + - uses: pnpm/action-setup@v4 |
| 68 | + with: |
| 69 | + version: 10.30.3 |
| 70 | + - uses: actions/setup-node@v4 |
| 71 | + with: |
| 72 | + node-version: '20' |
| 73 | + cache: 'pnpm' |
| 74 | + |
| 75 | + - name: Install dependencies |
| 76 | + run: pnpm install --frozen-lockfile |
| 77 | + |
| 78 | + - name: Build Demo |
| 79 | + run: pnpm run build:demo |
0 commit comments