diff --git a/.github/workflows/demos_visual_tests_frameworks.yml b/.github/workflows/demos_visual_tests_frameworks.yml index ef0ba75f407d..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 @@ -256,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 @@ -325,13 +327,52 @@ 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 timeout-minutes: 10 needs: - build-devextreme - - get-changes strategy: fail-fast: false @@ -345,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 @@ -376,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: | @@ -420,7 +456,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: @@ -451,12 +487,6 @@ jobs: with: name: devextreme-sources - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: changed-demos - path: apps/demos - - uses: pnpm/action-setup@v4 with: run_install: false