From edfcaf1c2286fd8f7c0bc7285a21c85689a1780f Mon Sep 17 00:00:00 2001 From: alexlavrov Date: Tue, 21 Jan 2025 15:35:23 +0400 Subject: [PATCH] Fix merging in demos tests --- .github/workflows/demos_visual_tests.yml | 30 +++++++++++++++++-- .../demos_visual_tests_frameworks.yml | 20 ++++++++++++- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/demos_visual_tests.yml b/.github/workflows/demos_visual_tests.yml index 055e270d6b7..9f85de70345 100644 --- a/.github/workflows/demos_visual_tests.yml +++ b/.github/workflows/demos_visual_tests.yml @@ -122,11 +122,15 @@ jobs: echo "::warning ::$message" fi + - name: Sanitize job name + if: ${{ failure() }} + run: echo "JOB_NAME=$(echo "${{ matrix.ARGS.name }}" | tr '/' '-')" >> $GITHUB_ENV + - name: Copy screenshots artifacts if: failure() && matrix.STRATEGY == 'screenshots' uses: actions/upload-artifact@v4 with: - name: screenshots + name: screenshots-${{ env.JOB_NAME }} path: ${{ github.workspace }}/apps/demos/testing/artifacts/compared-screenshots/**/* if-no-files-found: ignore @@ -134,6 +138,28 @@ jobs: if: matrix.STRATEGY == 'accessibility' uses: actions/upload-artifact@v4 with: - name: accessibility-reports + name: accessibility-reports-${{ env.JOB_NAME }} path: apps/demos/testing/artifacts/axe-reports/* if-no-files-found: ignore + + merge: + runs-on: devextreme-shr2 + needs: testcafe + if: contains(needs.*.result, 'failure') + + steps: + - name: Merge screenshot artifacts + uses: actions/upload-artifact/merge@v4 + continue-on-error: true + with: + name: screenshots + pattern: screenshots-* + delete-merged: true + + - name: Merge accessibility reports + uses: actions/upload-artifact/merge@v4 + continue-on-error: true + with: + name: accessibility-reports + pattern: accessibility-reports-* + delete-merged: true diff --git a/.github/workflows/demos_visual_tests_frameworks.yml b/.github/workflows/demos_visual_tests_frameworks.yml index 911355f956d..055ee8bb0ec 100644 --- a/.github/workflows/demos_visual_tests_frameworks.yml +++ b/.github/workflows/demos_visual_tests_frameworks.yml @@ -383,10 +383,28 @@ jobs: CI_ENV: true # The `ignore` field in the visualtestrc.json should be disabled when running test locally run: npx nx test-testcafe + - name: Sanitize job name + if: ${{ failure() }} + run: echo "JOB_NAME=$(echo "${{ matrix.ARGS.name }}" | tr '/' '-')" >> $GITHUB_ENV + - name: Copy screenshots artifacts if: ${{ failure() }} uses: actions/upload-artifact@v4 with: - name: screenshots + name: screenshots-${{ env.JOB_NAME }} path: ${{ github.workspace }}/apps/demos/testing/artifacts/compared-screenshots/**/* if-no-files-found: ignore + + merge: + runs-on: devextreme-shr2 + needs: testcafe + if: contains(needs.*.result, 'failure') + + steps: + - name: Merge screenshot artifacts + uses: actions/upload-artifact/merge@v4 + continue-on-error: true + with: + name: screenshots + pattern: screenshots-* + delete-merged: true