Skip to content

Commit 2136d28

Browse files
committed
updated unit test workflow and added parallel execution
1 parent 956306e commit 2136d28

2 files changed

Lines changed: 106 additions & 3 deletions

File tree

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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 }}

.github/workflows/unit-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ jobs:
9595
working-directory: ./packages/contentstack-clone
9696
run: npm run test:unit
9797

98-
- name: Run tests for Contentstack External Migrate
99-
working-directory: ./packages/contentstack-external-migrate
100-
run: npm test
98+
# - name: Run tests for Contentstack External Migrate
99+
# working-directory: ./packages/contentstack-external-migrate
100+
# run: npm test
101101

102102
- name: Run tests for Contentstack Seed
103103
working-directory: ./packages/contentstack-seed

0 commit comments

Comments
 (0)