Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Jan 31, 2025
1 parent 9106a96 commit 8471765
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 53 deletions.
65 changes: 16 additions & 49 deletions .github/workflows/icons-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
process-icons:
name: Fetch and Build Icons

runs-on: ubuntu-latest
runs-on: macos-latest

timeout-minutes: 60

Expand Down Expand Up @@ -57,48 +57,6 @@ 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
uses: actions/cache@v4
id: yarn-cache
with:
path: ./.yarn/cache
key: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-deps-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-deps-

- name: Install dependencies
run: yarn install --immutable

- name: Use Playwright cache
uses: actions/cache@v4
id: playwright-cache
Expand All @@ -113,21 +71,30 @@ jobs:
- run: yarn workspace @dnb/eufemia playwright install-deps firefox
if: steps.playwright-cache.outputs.cache-hit == 'true'

- name: Re-store portal artifacts
uses: actions/download-artifact@v4.1.7
with:
name: portal-build-artifact
path: ./packages/dnb-design-system-portal/public

- 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

- uses: actions/upload-artifact@v4
if: failure()
with:
name: visual-test-artifact
path: |
./packages/dnb-eufemia/src/**/*.snap-diff.png
./packages/dnb-eufemia/jest-visual-diff-report/*
- 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:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/visual-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ jobs:
timeout-minutes: 40

steps:
- name: Check branch and exit early
if: startsWith(github.ref, 'refs/heads/icon')
run: echo "Skipping this run on icon* branches" && exit 0

- name: Git checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Check branch and exit early
if: startsWith(github.ref, 'refs/heads/icon')
run: echo "Skipping this run on icon* branches" && exit 0

- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down

0 comments on commit 8471765

Please sign in to comment.