@@ -11,104 +11,38 @@ jobs:
1111 - name : Checkout code
1212 uses : actions/checkout@v4
1313
14+ - name : Setup pnpm
15+ uses : pnpm/action-setup@v4
16+ with :
17+ version : 10.28.0 # or your local pnpm version
18+
1419 - name : Set up Node.js
1520 uses : actions/setup-node@v4
1621 with :
1722 node-version : ' 22.x'
23+ cache : ' pnpm' # optional but recommended
1824
19- - name : Install dependencies for all plugins
20- run : |
21- NODE_ENV=PREPACK_MODE npm run setup-repo-old
25+ # - name: Temporarily disable contentstack package
26+ # run: mv packages/contentstack/package.json packages/contentstack/package.json.disabled || true
2227
23- - name : Run tests for Contentstack Command
24- working-directory : ./packages/contentstack-command
25- run : npm run test:unit
28+ - name : Install Dependencies (Excluding Contentstack)
29+ run : pnpm install --frozen-lockfile
2630
27- - name : Run tests for Contentstack Import Plugin
28- working-directory : ./packages/contentstack-import
29- run : npm run test:unit
31+ - name : Build all plugins (Excluding Contentstack)
32+ run : |
33+ NODE_ENV=PREPACK_MODE pnpm -r --sort run build
3034
31- - name : Run tests for Contentstack Export Plugin
32- working-directory : ./packages/contentstack-export
33- run : npm run test:unit
35+ # - name: Restore contentstack package
36+ # run: mv packages/contentstack/package.json.disabled packages/contentstack/package.json || true
3437
35- - name : Run tests for Audit plugin
36- working-directory : ./packages/contentstack-audit
38+ - name : Run tests for Contentstack Command
39+ working-directory : ./packages/contentstack-command
3740 run : npm run test:unit
3841
3942 - name : Run tests for Contentstack Config
4043 working-directory : ./packages/contentstack-config
41- run : npm run test
42-
43- - name : Run tests for Contentstack Migrate RTE
44- working-directory : ./packages/contentstack-migrate-rte
45- run : npm run test
46-
47- - name : Run tests for Contentstack Migration
48- working-directory : ./packages/contentstack-migration
49- run : npm run test
50-
51- - name : Run tests for Contentstack Export To CSV
52- working-directory : ./packages/contentstack-export-to-csv
5344 run : npm run test:unit
5445
55- - name : Run tests for Contentstack Bootstrap
56- working-directory : ./packages/contentstack-bootstrap
57- run : npm run test
58-
5946 - name : Run tests for Contentstack Auth
6047 working-directory : ./packages/contentstack-auth
61- run : npm run test:unit
62-
63- # - name: Run tests for Contentstack Import Setup
64- # working-directory: ./packages/contentstack-import-setup
65- # run: npm run test:unit
66-
67- - name : Run tests for Contentstack Bulk Publish
68- working-directory : ./packages/contentstack-bulk-publish
69- run : npm run test:unit
70-
71- - name : Run tests for Contentstack Branches
72- working-directory : ./packages/contentstack-branches
73- run : npm run test:unit
74-
75- - name : Run tests for Contentstack Clone
76- working-directory : ./packages/contentstack-clone
77- run : npm run test:unit
78-
79- # - name: Fetch latest references
80- # run: |
81- # git fetch --prune
82-
83- # - name: Identify Changed Plugins
84- # id: changes
85- # run: |
86- # echo "Finding changed files..."
87- # # Ensure both commit references are valid
88- # if [[ -z "${{ github.event.before }}" || -z "${{ github.sha }}" ]]; then
89- # echo "Error: Missing commit references"
90- # exit 1
91- # fi
92-
93- # CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
94- # echo "Changed files:"
95- # echo "$CHANGED_FILES"
96-
97- # # Identify affected plugins
98- # AFFECTED_PLUGINS=$(echo "$CHANGED_FILES" | grep -oP '(?<=^packages/)([^/]+)' | sort -u | tr '\n' ' ')
99- # echo "Affected plugins: $AFFECTED_PLUGINS"
100-
101- # # Set output for the next step
102- # echo "::set-output name=affected_plugins::$AFFECTED_PLUGINS"
103-
104- # - name: Run Unit Tests for Affected Plugins
105- # run: |
106- # for plugin in ${{ steps.changes.outputs.affected_plugins }}; do
107- # echo "Checking if tests should run for $plugin..."
108- # if [[ "$plugin" == "contentstack-audit" ]]; then
109- # echo "Running tests for contentstack-audit..."
110- # npm run test:unit --prefix ./packages/contentstack-audit
111- # else
112- # echo "contentstack-audit has not changed. Skipping tests."
113- # fi
114- # done
48+ run : NODE_ENV=PREPACK_MODE npm run test:unit
0 commit comments