From eca2f728ce62ca164c88a81f445c7ed43bafd217 Mon Sep 17 00:00:00 2001 From: mimo Date: Thu, 15 Feb 2024 15:23:34 +0900 Subject: [PATCH] feat: add archiving diff_output workflow --- .github/workflows/test.yml | 14 ++++++++++++++ .storybook/test-runner.ts | 2 ++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 31aa00b28..100d10404 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,20 @@ jobs: "npx http-server storybook-static --port 6006 --silent" \ "npx wait-on tcp:127.0.0.1:6006 && yarn test-storybook" + - name: Check __diff_output__ existence + id: check_diff_output_dir + if: ${{ always() }} + uses: andstor/file-existence-action@v1 + with: + files: '__diff_output__/' + + - name: Archive image snapshot diffs + uses: actions/upload-artifact@v4 + if: steps.check_diff_output_dir.outputs.files_exists == 'true' && ${{ always() }} + with: + name: upload_diff_output + path: __diff_output__/ + lint: runs-on: ubuntu-latest steps: diff --git a/.storybook/test-runner.ts b/.storybook/test-runner.ts index f83ca7502..74c3d7ec2 100644 --- a/.storybook/test-runner.ts +++ b/.storybook/test-runner.ts @@ -11,6 +11,8 @@ const config: TestRunnerConfig = { expect(image).toMatchImageSnapshot({ customSnapshotIdentifier: context.id, customDiffDir: `${process.cwd()}/__diff_output__`, + failureThresholdType: 'percent', + failureThreshold: 0.001, }) }, tags: {