Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Enable Chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
amacneil committed Mar 11, 2021
1 parent 34c2665 commit 9396dd4
Show file tree
Hide file tree
Showing 4 changed files with 817 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -23,12 +23,15 @@ jobs:
command: test --maxWorkers=100%
- name: storybook
command: storybook:ci
- name: chromatic
command: chromatic

name: ${{ matrix.config.name }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Configure Node.js
uses: actions/setup-node@v2.1.5
Expand All @@ -52,6 +55,9 @@ jobs:
- run: yarn install --immutable
- run: yarn run ${{ matrix.config.command }}
env:
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref }}
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
REG_SUIT_GITHUB_CLIENT_ID: ${{ secrets.REG_SUIT_GITHUB_CLIENT_ID }}
REG_SUIT_HEAD_SHA: ${{ github.sha }}
# `base.sha` works for pull request events, `before` works for pushes to main
Expand Down
3 changes: 3 additions & 0 deletions app/package.json
Expand Up @@ -2,6 +2,8 @@
"name": "@foxglove-studio/app",
"private": true,
"scripts": {
"chromatic": "chromatic --project-token $CHROMATIC_PROJECT_TOKEN --build-script-name storybook:build --exit-once-uploaded",
"storybook:build": "build-storybook",
"test": "NODE_OPTIONS='-r ts-node/register' jest",
"test:watch": "NODE_OPTIONS='-r ts-node/register' jest --watch"
},
Expand Down Expand Up @@ -132,6 +134,7 @@
"@types/ws": "7.4.0",
"@wojtekmaj/enzyme-adapter-react-17": "0.4.1",
"argparse": "2.0.1",
"chromatic": "github:amacneil/chromatic-cli#detectyarn",
"dom-to-image-more-scroll-fix": "2.9.0",
"enzyme": "3.11.0",
"fetch-mock": "9.11.0",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -33,7 +33,8 @@
"storybook": "yarn workspace @foxglove-studio/app run start-storybook",
"storybook-script": "cd ci && node --loader ts-node/esm --experimental-specifier-resolution=node storybook.ts",
"storybook:ci": "yarn storybook-script build capture publish",
"storybook:local-capture": "yarn storybook-script capture"
"storybook:local-capture": "yarn storybook-script capture",
"chromatic": "yarn workspace @foxglove-studio/app run chromatic"
},
"workspaces": {
"packages": [
Expand Down

0 comments on commit 9396dd4

Please sign in to comment.