From 9aaf191922584ffb3e284363b3d395941e780822 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Thu, 3 Oct 2024 16:32:31 +0300 Subject: [PATCH] chore: another experiment --- .github/screenshot-bot.config.toml | 2 +- .github/workflows/e2e.yml | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/screenshot-bot.config.toml b/.github/screenshot-bot.config.toml index 8b0465027d64..63258542591c 100644 --- a/.github/screenshot-bot.config.toml +++ b/.github/screenshot-bot.config.toml @@ -22,4 +22,4 @@ branchesIgnore = ["^release/.*", "^v[0-9].x$"] screenshotImageAttrs = [] # Text which is placed at the beginning of section "Failed tests" -failedTestsReportDescription = '### Before (main) <= Diff => After (local)' +failedTestsReportDescription = '

Before (main) ← Diff → After (local)

' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index af27274efbb5..3757b0d3b772 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -6,6 +6,7 @@ env: CYPRESS_BASELINE_REPO: 'baseline' CYPRESS_RESULTS_FOLDER: 'projects/demo-cypress/tests-results' CYPRESS_BASELINE_SNAPSHOTS: 'projects/demo-cypress/tests-results/snapshots/baseline' + CYPRESS_BASELINE_SNAPSHOTS_KEY: 'cy_baseline_${{ github.event.pull_request.head.sha }}' jobs: build-demo: @@ -41,23 +42,30 @@ jobs: - uses: taiga-family/ci/actions/setup/node@v1.93.0 - name: Run tests for baseline state - run: | - npx nx component-test demo-cypress - rm -r node_modules - find . -mindepth 1 -type f -not -path "**/demo-cypress/**/snapshots/baseline/**" -delete - find . -type d -empty -delete - tree . + run: npx nx component-test demo-cypress - - uses: actions/checkout@v4.2.0 + - name: Save Cypress Baseline Snapshots + uses: actions/upload-artifact@v4.4.0 with: - clean: false + path: ${{env.CYPRESS_BASELINE_SNAPSHOTS}} + name: ${{env.CYPRESS_BASELINE_SNAPSHOTS_KEY}} + if-no-files-found: ignore + compression-level: 0 + retention-days: 1 + + - uses: actions/checkout@v4.2.0 - uses: taiga-family/ci/actions/setup/variables@v1.93.0 - uses: taiga-family/ci/actions/setup/node@v1.93.0 + - name: Download Cypress Baseline Snapshots + uses: actions/download-artifact@v4.1.8 + with: + path: ${{env.CYPRESS_BASELINE_SNAPSHOTS}} + pattern: ${{ env.CYPRESS_BASELINE_SNAPSHOTS_KEY }} + merge-multiple: true + - name: Run tests for current state - run: | - tree ${{env.CYPRESS_BASELINE_SNAPSHOTS}} - npx nx component-test demo-cypress + run: npx nx component-test demo-cypress - name: Prepare diff screenshots run: |