From 5c30d129aba62688b54ff8fb58e1397b55cd60a4 Mon Sep 17 00:00:00 2001 From: Adam Howard <91115+codeincontext@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:53:48 +0100 Subject: [PATCH] test: add chromatic github workflow --- .github/workflows/chromatic.yml | 29 +++++++++++++++++++++++++++++ apps/nextjs/.storybook/preview.tsx | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/chromatic.yml diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml new file mode 100644 index 000000000..d9a7cd6d6 --- /dev/null +++ b/.github/workflows/chromatic.yml @@ -0,0 +1,29 @@ +name: "Chromatic" + +on: push + +jobs: + chromatic: + name: Run Chromatic + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + - name: Install dependencies + run: pnpm install + - name: Inject Doppler env vars + uses: dopplerhq/secrets-fetch-action@v1.2.0 + id: doppler + with: + doppler-token: ${{ secrets.DOPPLER_TOKEN }} + inject-env-vars: true + - name: Run Chromatic + uses: chromaui/action@latest + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} diff --git a/apps/nextjs/.storybook/preview.tsx b/apps/nextjs/.storybook/preview.tsx index 72ce0b217..ff270b2e2 100644 --- a/apps/nextjs/.storybook/preview.tsx +++ b/apps/nextjs/.storybook/preview.tsx @@ -41,7 +41,7 @@ export const decorators: Decorator[] = [ RadixThemeDecorator, (Story) => ( <> - {/* TODO: use a mocked provider */} + {/* TODO: Mock tRPC calls with MSW */}