From bbeddb896bd4c40f75004906b78f9c3701eac5ae Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Fri, 10 Oct 2025 23:02:06 +0400 Subject: [PATCH 1/3] CI: Skip demo framework tests when no changes detected or 'force all tests' is false (#31296) --- .../demos_visual_tests_frameworks.yml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/demos_visual_tests_frameworks.yml b/.github/workflows/demos_visual_tests_frameworks.yml index ef0ba75f407d..e8fda1792751 100644 --- a/.github/workflows/demos_visual_tests_frameworks.yml +++ b/.github/workflows/demos_visual_tests_frameworks.yml @@ -325,6 +325,46 @@ jobs: pnpm run lint-demos fi + - name: Run lint on changed demos + if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') + working-directory: apps/demos + env: + DEBUG: 'eslint:cli-engine,stylelint:standalone' + run: | + pnpx nx lint-non-demos + + if [ -f "changed-files.json" ]; then + echo "Running lint-demos on changed files" + CHANGED_DEMOS=$(jq -r '.[].filename' changed-files.json | grep '^apps/demos/Demos/' | sed 's|^apps/demos/||' | tr '\n' ' ') + if [ ! -z "$CHANGED_DEMOS" ]; then + echo "Changed demo files: $CHANGED_DEMOS" + pnpx eslint $CHANGED_DEMOS + else + echo "No demo files changed, skipping lint-demos" + fi + else + echo "changed-files.json not found" + pnpm run lint-demos + fi + + - name: Run lint on changed demos + if: github.event_name != 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') + working-directory: apps/demos + env: + DEBUG: 'eslint:cli-engine,stylelint:standalone' + run: | + pnpx nx lint-non-demos + + if [ -f "changed-files.json" ]; then + echo "Running lint-demos on changed files" + CHANGED_DEMOS=$(jq -r '.[].filename' changed-files.json | grep '^apps/demos/Demos/' | sed 's|^apps/demos/||' | tr '\n' ' ') + if [ ! -z "$CHANGED_DEMOS" ]; then + echo "Changed demo files: $CHANGED_DEMOS" + pnpx eslint $CHANGED_DEMOS + else + echo "No demo files changed, skipping lint-demos" + fi + check_generated_demos: name: ${{ matrix.name }} runs-on: ubuntu-22.04 From 4057493c1d7c7317f24d4eb54fd6ac9239da5d90 Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Tue, 14 Oct 2025 11:27:20 +0400 Subject: [PATCH 2/3] update --- .github/workflows/demos_visual_tests_frameworks.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/demos_visual_tests_frameworks.yml b/.github/workflows/demos_visual_tests_frameworks.yml index e8fda1792751..f7e8147862fd 100644 --- a/.github/workflows/demos_visual_tests_frameworks.yml +++ b/.github/workflows/demos_visual_tests_frameworks.yml @@ -161,6 +161,7 @@ jobs: uses: actions/checkout@v4 - name: Get changed files + if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') uses: DevExpress/github-actions/get-changed-files@v1 with: gh-token: ${{ secrets.GITHUB_TOKEN }} @@ -168,6 +169,7 @@ jobs: output: apps/demos/changed-files.json - name: Display changed files + if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') run: | if [ -f "apps/demos/changed-files.json" ]; then echo "Found changed-files.json" @@ -371,7 +373,6 @@ jobs: timeout-minutes: 10 needs: - build-devextreme - - get-changes strategy: fail-fast: false @@ -460,7 +461,7 @@ jobs: testcafe: needs: build-demos - if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'force all tests') + if: contains(github.event.pull_request.labels.*.name, 'force all tests') strategy: fail-fast: false matrix: @@ -492,6 +493,7 @@ jobs: name: devextreme-sources - name: Download artifacts + if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') uses: actions/download-artifact@v4 with: name: changed-demos From bb0ad031a36a1ea44bfdb28f7af14f06dd8e1f8d Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Tue, 14 Oct 2025 11:27:38 +0400 Subject: [PATCH 3/3] update --- .../demos_visual_tests_frameworks.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/demos_visual_tests_frameworks.yml b/.github/workflows/demos_visual_tests_frameworks.yml index f7e8147862fd..689b199a2660 100644 --- a/.github/workflows/demos_visual_tests_frameworks.yml +++ b/.github/workflows/demos_visual_tests_frameworks.yml @@ -153,6 +153,7 @@ jobs: get-changes: runs-on: ubuntu-22.04 + if: github.event_name == 'pull_request' name: Get changed demos timeout-minutes: 5 @@ -161,7 +162,6 @@ jobs: uses: actions/checkout@v4 - name: Get changed files - if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') uses: DevExpress/github-actions/get-changed-files@v1 with: gh-token: ${{ secrets.GITHUB_TOKEN }} @@ -169,7 +169,6 @@ jobs: output: apps/demos/changed-files.json - name: Display changed files - if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') run: | if [ -f "apps/demos/changed-files.json" ]; then echo "Found changed-files.json" @@ -258,6 +257,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifacts + if: github.event_name == 'pull_request' uses: actions/download-artifact@v4 with: name: changed-demos @@ -386,6 +386,7 @@ jobs: uses: actions/checkout@v4 - name: Download artifacts + if: github.event_name == 'pull_request' uses: actions/download-artifact@v4 with: name: changed-demos @@ -417,12 +418,6 @@ jobs: working-directory: apps/demos run: pnpm run prepare-js - - name: Download changed demos info - uses: actions/download-artifact@v4 - with: - name: changed-demos - path: apps/demos - - name: Check generated JS demos working-directory: apps/demos run: | @@ -492,13 +487,6 @@ jobs: with: name: devextreme-sources - - name: Download artifacts - if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'force all tests') - uses: actions/download-artifact@v4 - with: - name: changed-demos - path: apps/demos - - uses: pnpm/action-setup@v4 with: run_install: false