@@ -134,10 +134,12 @@ jobs:
134134# run: pnpm install
135135
136136 - name : Prepare bundles
137+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'force all tests')
137138 working-directory : apps/demos
138139 run : pnpx nx prepare-bundles
139140
140141 - name : Demos - Run tsc
142+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'force all tests')
141143 working-directory : apps/demos
142144 run : tsc --noEmit
143145
@@ -160,12 +162,22 @@ jobs:
160162
161163 - name : Get changed files
162164 uses : DevExpress/github-actions/get-changed-files@v1
163- if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests')
164165 with :
165166 gh-token : ${{ secrets.GITHUB_TOKEN }}
166167 paths : ' apps/demos/Demos/**/*'
167168 output : apps/demos/changed-files.json
168169
170+ - name : Display changed files
171+ run : |
172+ if [ -f "apps/demos/changed-files.json" ]; then
173+ echo "Found changed-files.json"
174+ echo "Content of changed-files.json:"
175+ cat apps/demos/changed-files.json
176+ echo "Number of changed files: $(jq length apps/demos/changed-files.json)"
177+ else
178+ echo "changed-files.json not found"
179+ fi
180+
169181 - name : Upload artifacts
170182 uses : actions/upload-artifact@v4
171183 with :
@@ -244,7 +256,6 @@ jobs:
244256 uses : actions/checkout@v4
245257
246258 - name : Download artifacts
247- if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests')
248259 uses : actions/download-artifact@v4
249260 with :
250261 name : changed-demos
@@ -285,47 +296,60 @@ jobs:
285296 - name : Install tgz
286297 run : pnpm add -w ./devextreme-installer.tgz ./devextreme-dist-installer.tgz ./devextreme-react-installer.tgz ./devextreme-vue-installer.tgz ./devextreme-angular-installer.tgz
287298
288- - uses : actions/setup-dotnet@v4
289- with :
290- dotnet-version : 5.0.408
291-
292- - name : Prepare dotnet
293- run : |
294- dotnet new globaljson --sdk-version 5.0.408
295- dotnet tool install -g dotnet-format --version 5.1.225507
296-
297- - name : Run lint
299+ - name : Run lint on all demos
300+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'force all tests')
298301 working-directory : apps/demos
299302 env :
300- CHANGEDFILEINFOSPATH : changed-files.json
301303 DEBUG : ' eslint:cli-engine,stylelint:standalone'
302304 run : pnpx nx lint
303305
306+ - name : Run lint on changed demos
307+ if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests')
308+ working-directory : apps/demos
309+ env :
310+ DEBUG : ' eslint:cli-engine,stylelint:standalone'
311+ run : |
312+ pnpx nx lint-non-demos
313+
314+ if [ -f "changed-files.json" ]; then
315+ echo "Running lint-demos on changed files"
316+ CHANGED_DEMOS=$(jq -r '.[].filename' changed-files.json | grep '^apps/demos/Demos/' | sed 's|^apps/demos/||' | tr '\n' ' ')
317+ if [ ! -z "$CHANGED_DEMOS" ]; then
318+ echo "Changed demo files: $CHANGED_DEMOS"
319+ pnpx eslint $CHANGED_DEMOS
320+ else
321+ echo "No demo files changed, skipping lint-demos"
322+ fi
323+ else
324+ echo "changed-files.json not found"
325+ pnpm run lint-demos
326+ fi
327+
304328 check_generated_demos :
305329 name : ${{ matrix.name }}
306330 runs-on : ubuntu-22.04
307331 timeout-minutes : 10
308- needs : build-demos
332+ needs :
333+ - build-devextreme
334+ - get-changes
309335
310336 strategy :
311337 fail-fast : false
312338 matrix :
313339 include :
314- - name : Check generated demos (1/5)
315- command : CONSTEL=1/5 pnpm run convert-to-js
316- - name : Check generated demos (2/5)
317- command : CONSTEL=2/5 pnpm run convert-to-js
318- - name : Check generated demos (3/5)
319- command : CONSTEL=3/5 pnpm run convert-to-js
320- - name : Check generated demos (4/5)
321- command : CONSTEL=4/5 pnpm run convert-to-js
322- - name : Check generated demos (5/5)
323- command : CONSTEL=5/5 pnpm run convert-to-js
340+ - name : Check generated demos
341+ command : pnpm run convert-to-js
324342
325343 steps :
326344 - name : Get sources
327345 uses : actions/checkout@v4
328346
347+ - name : Download artifacts
348+ uses : actions/download-artifact@v4
349+ with :
350+ name : changed-demos
351+ path : apps/demos
352+
329353 - uses : pnpm/action-setup@v4
330354 with :
331355 run_install : false
@@ -336,21 +360,6 @@ jobs:
336360 node-version : ' 20'
337361 cache : ' pnpm'
338362
339- # - name: Get pnpm store directory
340- # shell: bash
341- # run: |
342- # echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
343- #
344- # - uses: actions/cache@v4
345- # name: Setup pnpm cache
346- # with:
347- # path: |
348- # ${{ env.STORE_PATH }}
349- # .nx/cache
350- # key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
351- # restore-keys: |
352- # ${{ runner.os }}-pnpm-store
353-
354363 - name : Download devextreme sources
355364 uses : actions/download-artifact@v4
356365 with :
@@ -367,10 +376,37 @@ jobs:
367376 working-directory : apps/demos
368377 run : pnpm run prepare-js
369378
379+ - name : Download changed demos info
380+ uses : actions/download-artifact@v4
381+ with :
382+ name : changed-demos
383+ path : apps/demos
384+
370385 - name : Check generated JS demos
371386 working-directory : apps/demos
372387 run : |
373- ${{ matrix.command }}
388+ if [ -f "changed-files.json" ]; then
389+ echo "Running convert-to-js on changed files only"
390+
391+ CHANGED_DEMOS=$(jq -r '.[].filename' changed-files.json | grep '/React/' | grep '\.tsx$' | sed 's|^apps/demos/||' | sed 's|/[^/]*\.tsx$||' | sort | uniq)
392+
393+ if [ -z "$CHANGED_DEMOS" ]; then
394+ echo "No React demos found in changed files, skipping conversion"
395+ else
396+ echo "Changed React demos:"
397+ echo "$CHANGED_DEMOS"
398+
399+ echo "$CHANGED_DEMOS" | while read -r demo_dir; do
400+ if [ ! -z "$demo_dir" ]; then
401+ echo "Converting: $demo_dir"
402+ pnpm run convert-to-js "$demo_dir"
403+ fi
404+ done
405+ fi
406+ else
407+ echo "Running convert-to-js on all files"
408+ ${{ matrix.command }}
409+ fi
374410
375411 git add ./Demos -N
376412
@@ -384,6 +420,7 @@ jobs:
384420
385421 testcafe :
386422 needs : build-demos
423+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'force all tests')
387424 strategy :
388425 fail-fast : false
389426 matrix :
@@ -415,7 +452,6 @@ jobs:
415452 name : devextreme-sources
416453
417454 - name : Download artifacts
418- if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests')
419455 uses : actions/download-artifact@v4
420456 with :
421457 name : changed-demos
@@ -447,9 +483,6 @@ jobs:
447483 working-directory : apps/demos
448484 run : pnpm add ../../devextreme-installer.tgz ../../devextreme-dist-installer.tgz ../../devextreme-react-installer.tgz ../../devextreme-vue-installer.tgz ../../devextreme-angular-installer.tgz
449485
450- # - name: Build wrappers
451- # run: pnpm exec nx run-many -t pack -p devextreme-angular devextreme-react devetreme-vue
452-
453486 - name : Prepare JS
454487 working-directory : apps/demos
455488 run : pnpm run prepare-js
0 commit comments