@@ -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
@@ -151,6 +153,7 @@ jobs:
151153
152154 get-changes :
153155 runs-on : ubuntu-22.04
156+ if : github.event_name == 'pull_request'
154157 name : Get changed demos
155158 timeout-minutes : 5
156159
@@ -160,12 +163,22 @@ jobs:
160163
161164 - name : Get changed files
162165 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')
164166 with :
165167 gh-token : ${{ secrets.GITHUB_TOKEN }}
166168 paths : ' apps/demos/Demos/**/*'
167169 output : apps/demos/changed-files.json
168170
171+ - name : Display changed files
172+ run : |
173+ if [ -f "apps/demos/changed-files.json" ]; then
174+ echo "Found changed-files.json"
175+ echo "Content of changed-files.json:"
176+ cat apps/demos/changed-files.json
177+ echo "Number of changed files: $(jq length apps/demos/changed-files.json)"
178+ else
179+ echo "changed-files.json not found"
180+ fi
181+
169182 - name : Upload artifacts
170183 uses : actions/upload-artifact@v4
171184 with :
@@ -234,7 +247,6 @@ jobs:
234247 name : Lint code base
235248 needs :
236249 - build-devextreme
237- - get-changes
238250
239251 runs-on : ubuntu-22.04
240252 timeout-minutes : 60
@@ -244,7 +256,7 @@ 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')
259+ if : github.event_name == 'pull_request'
248260 uses : actions/download-artifact@v4
249261 with :
250262 name : changed-demos
@@ -285,47 +297,66 @@ jobs:
285297 - name : Install tgz
286298 run : pnpm add -w ./devextreme-installer.tgz ./devextreme-dist-installer.tgz ./devextreme-react-installer.tgz ./devextreme-vue-installer.tgz ./devextreme-angular-installer.tgz
287299
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
300+ - name : Run lint on all demos
301+ if : github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'force all tests')
298302 working-directory : apps/demos
299303 env :
300- CHANGEDFILEINFOSPATH : changed-files.json
301304 DEBUG : ' eslint:cli-engine,stylelint:standalone'
302305 run : pnpx nx lint
303306
307+ - name : Run lint on changed demos
308+ if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests')
309+ working-directory : apps/demos
310+ env :
311+ DEBUG : ' eslint:cli-engine,stylelint:standalone'
312+ run : |
313+ pnpx nx lint-non-demos
314+
315+ if [ -f "changed-files.json" ]; then
316+ echo "Running lint-demos on changed files"
317+ CHANGED_DEMOS=$(jq -r '.[].filename' changed-files.json \
318+ | grep '^apps/demos/Demos/' \
319+ | sed 's|^apps/demos/||' \
320+ | while read f; do
321+ [ -f "$f" ] && echo "$f"
322+ done \
323+ | tr '\n' ' ')
324+ if [ ! -z "$CHANGED_DEMOS" ]; then
325+ echo "Changed demo files: $CHANGED_DEMOS"
326+ pnpx eslint $CHANGED_DEMOS
327+ else
328+ echo "No demo files changed, skipping lint-demos"
329+ fi
330+ else
331+ echo "changed-files.json not found"
332+ pnpm run lint-demos
333+ fi
334+
304335 check_generated_demos :
305336 name : ${{ matrix.name }}
306337 runs-on : ubuntu-22.04
307338 timeout-minutes : 10
308- needs : build-demos
339+ needs :
340+ - build-devextreme
309341
310342 strategy :
311343 fail-fast : false
312344 matrix :
313345 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
346+ - name : Check generated demos
347+ command : pnpm run convert-to-js
324348
325349 steps :
326350 - name : Get sources
327351 uses : actions/checkout@v4
328352
353+ - name : Download artifacts
354+ if : github.event_name == 'pull_request'
355+ uses : actions/download-artifact@v4
356+ with :
357+ name : changed-demos
358+ path : apps/demos
359+
329360 - uses : pnpm/action-setup@v4
330361 with :
331362 run_install : false
@@ -336,21 +367,6 @@ jobs:
336367 node-version : ' 20'
337368 cache : ' pnpm'
338369
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-
354370 - name : Download devextreme sources
355371 uses : actions/download-artifact@v4
356372 with :
@@ -368,9 +384,31 @@ jobs:
368384 run : pnpm run prepare-js
369385
370386 - name : Check generated JS demos
387+ if : github.event_name == 'pull_request'
371388 working-directory : apps/demos
372389 run : |
373- ${{ matrix.command }}
390+ if [ -f "changed-files.json" ]; then
391+ echo "Running convert-to-js on changed files only"
392+
393+ CHANGED_DEMOS=$(jq -r '.[].filename' changed-files.json | grep '/React/' | grep '\.tsx$' | sed 's|^apps/demos/||' | sed 's|/[^/]*\.tsx$||' | sort | uniq)
394+
395+ if [ -z "$CHANGED_DEMOS" ]; then
396+ echo "No React demos found in changed files, skipping conversion"
397+ else
398+ echo "Changed React demos:"
399+ echo "$CHANGED_DEMOS"
400+
401+ echo "$CHANGED_DEMOS" | while read -r demo_dir; do
402+ if [ ! -z "$demo_dir" ]; then
403+ echo "Converting: $demo_dir"
404+ pnpm run convert-to-js "$demo_dir"
405+ fi
406+ done
407+ fi
408+ else
409+ echo "Running convert-to-js on all files"
410+ ${{ matrix.command }}
411+ fi
374412
375413 git add ./Demos -N
376414
@@ -384,11 +422,12 @@ jobs:
384422
385423 testcafe :
386424 needs : build-demos
425+ if : contains(github.event.pull_request.labels.*.name, 'force all tests')
387426 strategy :
388427 fail-fast : false
389428 matrix :
390429 CONSTEL : [react(1/4), react(2/4), react(3/4), react(4/4), vue(1/4), vue(2/4), vue(3/4), vue(4/4), angular(1/4), angular(2/4), angular(3/4), angular(4/4)]
391- THEME : ['generic.light', 'material.blue.light', ' fluent.blue.light']
430+ THEME : ['fluent.blue.light']
392431
393432 runs-on : ubuntu-22.04
394433 name : testcafe-${{ matrix.CONSTEL }}-${{ matrix.THEME }}
@@ -414,13 +453,6 @@ jobs:
414453 with :
415454 name : devextreme-sources
416455
417- - name : Download artifacts
418- if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests')
419- uses : actions/download-artifact@v4
420- with :
421- name : changed-demos
422- path : apps/demos
423-
424456 - uses : pnpm/action-setup@v4
425457 with :
426458 run_install : false
@@ -447,9 +479,6 @@ jobs:
447479 working-directory : apps/demos
448480 run : pnpm add ../../devextreme-installer.tgz ../../devextreme-dist-installer.tgz ../../devextreme-react-installer.tgz ../../devextreme-vue-installer.tgz ../../devextreme-angular-installer.tgz
449481
450- # - name: Build wrappers
451- # run: pnpm exec nx run-many -t pack -p devextreme-angular devextreme-react devetreme-vue
452-
453482 - name : Prepare JS
454483 working-directory : apps/demos
455484 run : pnpm run prepare-js
0 commit comments