|
| 1 | +name: Run Unit Tests (Parallel) |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + setup: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout code |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Setup pnpm |
| 16 | + uses: pnpm/action-setup@v4 |
| 17 | + with: |
| 18 | + version: 10.28.0 |
| 19 | + |
| 20 | + - name: Set up Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: '22.x' |
| 24 | + cache: 'pnpm' |
| 25 | + |
| 26 | + - name: Prune pnpm store |
| 27 | + run: pnpm store prune |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: pnpm install --no-frozen-lockfile |
| 31 | + |
| 32 | + - name: Build all plugins |
| 33 | + run: NODE_ENV=PREPACK_MODE pnpm -r --sort run build |
| 34 | + |
| 35 | + - name: Upload workspace |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: built-workspace-${{ github.sha }} |
| 39 | + path: . |
| 40 | + retention-days: 1 |
| 41 | + compression-level: 6 |
| 42 | + |
| 43 | + test: |
| 44 | + needs: setup |
| 45 | + runs-on: ubuntu-latest |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: |
| 49 | + include: |
| 50 | + - package: contentstack-import |
| 51 | + cmd: npm run test:unit |
| 52 | + - package: contentstack-export |
| 53 | + cmd: npm run test:unit |
| 54 | + - package: contentstack-audit |
| 55 | + cmd: npm run test:unit |
| 56 | + - package: contentstack-migration |
| 57 | + cmd: npm run test |
| 58 | + - package: contentstack-export-to-csv |
| 59 | + cmd: npm run test:unit |
| 60 | + - package: contentstack-bootstrap |
| 61 | + cmd: npm run test |
| 62 | + - package: contentstack-import-setup |
| 63 | + cmd: npm run test:unit |
| 64 | + - package: contentstack-branches |
| 65 | + cmd: npm run test:unit |
| 66 | + - package: contentstack-query-export |
| 67 | + cmd: npm run test:unit |
| 68 | + - package: contentstack-apps-cli |
| 69 | + cmd: npm run test:unit:report |
| 70 | + - package: contentstack-content-type |
| 71 | + cmd: npm run test:unit |
| 72 | + - package: contentstack-cli-cm-regex-validate |
| 73 | + cmd: npm run test:unit |
| 74 | + - package: contentstack-migrate-rte |
| 75 | + cmd: npm test |
| 76 | + - package: contentstack-bulk-operations |
| 77 | + cmd: npm test |
| 78 | + - package: contentstack-variants |
| 79 | + cmd: npm run test |
| 80 | + - package: contentstack-asset-management |
| 81 | + cmd: npm run test:unit |
| 82 | + - package: contentstack-clone |
| 83 | + cmd: npm run test:unit |
| 84 | + # - package: contentstack-external-migrate # DX-9432: ESLint errors blocking CI — assigned to Netraj |
| 85 | + # cmd: npm test |
| 86 | + - package: contentstack-seed |
| 87 | + cmd: npm test |
| 88 | + |
| 89 | + steps: |
| 90 | + - name: Download workspace |
| 91 | + uses: actions/download-artifact@v4 |
| 92 | + with: |
| 93 | + name: built-workspace-${{ github.sha }} |
| 94 | + path: . |
| 95 | + |
| 96 | + - name: Set up Node.js |
| 97 | + uses: actions/setup-node@v4 |
| 98 | + with: |
| 99 | + node-version: '22.x' |
| 100 | + |
| 101 | + - name: Run tests — ${{ matrix.package }} |
| 102 | + working-directory: ./packages/${{ matrix.package }} |
| 103 | + run: ${{ matrix.cmd }} |
0 commit comments