From 9106a96751e33a4dbe052fdc706b5ded86afce93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20H=C3=B8egh?= Date: Thu, 30 Jan 2025 16:11:36 +0100 Subject: [PATCH] Ensure we update visual snapshot on CI --- .github/workflows/icons-lib.yml | 2 +- .github/workflows/visual-regression.yml | 4 ++++ packages/dnb-eufemia/package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/icons-lib.yml b/.github/workflows/icons-lib.yml index a4f50ad3e66..c3f10b1dbd8 100644 --- a/.github/workflows/icons-lib.yml +++ b/.github/workflows/icons-lib.yml @@ -123,7 +123,7 @@ jobs: run: yarn workspace dnb-design-system-portal build:visual-test - name: Run visual tests - run: yarn workspace dnb-design-system-portal test:screenshots:ci + run: yarn workspace dnb-design-system-portal test:screenshots:ci:update - name: Commit updated snapshots run: yarn workspace @dnb/eufemia postbuild:commit diff --git a/.github/workflows/visual-regression.yml b/.github/workflows/visual-regression.yml index 8049784b35e..f20c64b00e8 100644 --- a/.github/workflows/visual-regression.yml +++ b/.github/workflows/visual-regression.yml @@ -47,6 +47,10 @@ 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: diff --git a/packages/dnb-eufemia/package.json b/packages/dnb-eufemia/package.json index b7dbd3d3041..bb0e2bd157a 100644 --- a/packages/dnb-eufemia/package.json +++ b/packages/dnb-eufemia/package.json @@ -84,7 +84,7 @@ "test:postbuild": "yarn jest ./postbuild.test.ts --ci --testPathIgnorePatterns=[]", "test:screenshots": "yarn jest --config=./jest.config.screenshots.js --maxWorkers=1 --detectOpenHandles --testPathPattern ", "test:screenshots:ci": "yarn jest --config=./jest.config.screenshots.js --ci --bail --maxWorkers=1", - "test:screenshots:ci:update": "yarn test:screenshots:ci --maxWorkers=1 --updateSnapshot", + "test:screenshots:ci:update": "yarn test:screenshots:ci --updateSnapshot", "test:screenshots:reset": "find . -name '*.snap.png' -type f|xargs rm -f && yarn test:screenshots", "test:screenshots:update": "yarn jest --config=./jest.config.screenshots.js --maxWorkers=1 --updateSnapshot --testPathPattern ", "test:screenshots:watch": "JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE=1 jest --config=./jest.config.screenshots.js --watchAll --detectOpenHandles --testPathPattern ",