Skip to content

Commit

Permalink
ci: move Chromatic to separate workflow and also run it after PR is m…
Browse files Browse the repository at this point in the history
…erged (#2599)

This allows Chromatic to set the new baseline for main/next branches
  • Loading branch information
unekinn authored Oct 10, 2024
1 parent 2238293 commit 3ff6c5e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/test.yml
- 'packages/**'
- 'apps/storybook/**'

Expand All @@ -17,9 +18,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Necessary for Chromatic
fetch-depth: 0
- uses: ./.github/actions/gh-setup
- name: Build
run: yarn build
Expand Down Expand Up @@ -67,11 +65,3 @@ jobs:
check_name: Storybook Test Report
check_annotations: true
check_title_template: '{{FILE_NAME}} / {{TEST_NAME}}'

- name: Run Chromatic (visual and interaction tests)
uses: chromaui/action@latest
with:
workingDir: apps/storybook
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
autoAcceptChanges: '{main,next}'
34 changes: 34 additions & 0 deletions .github/workflows/visual-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Visual tests
on:
workflow_dispatch:
pull_request:
paths:
- .github/workflows/visual-tests.yml
- 'packages/**'
- 'apps/storybook/**'
push:
branches:
- main
- next

jobs:
checks:
name: Build & run visual/interaction tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Necessary for Chromatic
fetch-depth: 0
- uses: ./.github/actions/gh-setup
- name: Build
run: yarn build
- name: Build storybook
run: yarn build:storybook
- name: Run Chromatic (visual and interaction tests)
uses: chromaui/action@latest
with:
workingDir: apps/storybook
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
autoAcceptChanges: '{main,next}'

0 comments on commit 3ff6c5e

Please sign in to comment.