diff --git a/.github/workflows/icons-lib.yml b/.github/workflows/icons-lib.yml index d5d4737de4a..3a43d4cc6d4 100644 --- a/.github/workflows/icons-lib.yml +++ b/.github/workflows/icons-lib.yml @@ -21,7 +21,7 @@ jobs: process-icons: name: Fetch and Build Icons - runs-on: ubuntu-latest + runs-on: macos-latest timeout-minutes: 60 @@ -57,60 +57,44 @@ jobs: - name: Test prebuild run: yarn workspace @dnb/eufemia test:update - - name: Build portal - run: yarn workspace dnb-design-system-portal build:visual-test - - - name: Store portal artifacts - uses: actions/upload-artifact@v4 - with: - name: portal-build-artifact - path: ./packages/dnb-design-system-portal/public - - - name: Commit icons - run: yarn workspace @dnb/eufemia postbuild:commit - - visual-test: - needs: process-icons - name: Run visual e2e-test for icons - - runs-on: macos-latest - - timeout-minutes: 60 - - steps: - - name: Git checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version-file: 'package.json' - - - name: Use yarn cache + - name: Use Playwright cache uses: actions/cache@v4 - id: yarn-cache + id: playwright-cache with: - path: ./.yarn/cache - key: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-deps-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-deps- + path: | + ~/Library/Caches/ms-playwright + ~/.cache/ms-playwright + %USERPROFILE%\AppData\Local\ms-playwright + key: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-playwright-${{ hashFiles('**/yarn.lock') }} + - run: yarn workspace @dnb/eufemia playwright install --with-deps firefox + if: steps.playwright-cache.outputs.cache-hit != 'true' + - run: yarn workspace @dnb/eufemia playwright install-deps firefox + if: steps.playwright-cache.outputs.cache-hit == 'true' - - name: Install dependencies - run: yarn install --immutable + - name: Build portal + run: yarn workspace dnb-design-system-portal build:visual-test + + - name: Run visual tests + run: yarn workspace dnb-design-system-portal test:screenshots:ci:update - - name: Re-store portal artifacts - uses: actions/download-artifact@v4.1.7 + - uses: actions/upload-artifact@v4 + if: failure() with: - name: portal-build-artifact - path: ./packages/dnb-design-system-portal/public + name: visual-test-artifact + path: | + ./packages/dnb-eufemia/src/**/*.snap-diff.png + ./packages/dnb-eufemia/jest-visual-diff-report/* - - name: Run visual tests - run: yarn workspace dnb-design-system-portal test:screenshots:ci + - name: Run visual tests info + if: failure() + run: echo '\n\nšŸ‘‰ Download the diff files as a ZIP file. \nIt is called "visual-test-artifact" and you find it in the test "Summary" under "Artifacts".\n\n\n' - name: Commit updated snapshots run: yarn workspace @dnb/eufemia postbuild:commit + - name: Commit icons + run: yarn workspace @dnb/eufemia postbuild:commit + - name: Slack uses: 8398a7/action-slack@v3 with: diff --git a/.github/workflows/visual-regression.yml b/.github/workflows/visual-regression.yml index 8049784b35e..d66e428a404 100644 --- a/.github/workflows/visual-regression.yml +++ b/.github/workflows/visual-regression.yml @@ -94,6 +94,7 @@ jobs: run: yarn workspace dnb-design-system-portal build:visual-test - name: Run visual tests + if: '!startsWith(github.ref, "refs/heads/icon")' run: yarn workspace dnb-design-system-portal test:screenshots:ci - uses: actions/upload-artifact@v4