Skip to content

Commit

Permalink
build: remove chromatic logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Jul 3, 2024
1 parent 6222b25 commit 852c3c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 86 deletions.
69 changes: 0 additions & 69 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,75 +87,6 @@ jobs:
name: storybook
path: dist/storybook/

is-pr-open:
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: [build, lint, test]
outputs:
is-PR: ${{ !!fromJson(steps.get_issue_number.outputs.result).number }}
is-draft: ${{ fromJson(steps.get_issue_number.outputs.result).draft }}
title: ${{ fromJson(steps.get_issue_number.outputs.result).title }}
steps:
- uses: actions/github-script@v7
id: get_issue_number
with:
script: |
const pr = (await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})).data[0];
return pr ? {
number: pr.number,
title: pr.title,
draft: pr.draft,
state: pr.state
} : {};
- name: Log
run: echo "Number ${number}, isDraft ${isDraft}, title '${title}', data ${data}"
env:
data: ${{ steps.get_issue_number.outputs.result }}
number: ${{ fromJson(steps.get_issue_number.outputs.result).number }}
title: ${{ fromJson(steps.get_issue_number.outputs.result).title }}
isDraft: ${{ fromJson(steps.get_issue_number.outputs.result).draft }}

chromatic:
runs-on: ubuntu-latest
if: github.event_name == 'push' && needs.is-pr-open.outputs.is-PR == 'true' && needs.is-pr-open.outputs.is-draft == 'false'
needs: [is-pr-open]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install --frozen-lockfile --non-interactive
- name: Generate chromatic stories
run: yarn generate:chromatic-stories
- uses: actions/github-script@v7
id: version
with:
script: |
const sha = context.payload.pull_request?.head.sha ?? context.sha;
return `${require('./package.json').version}-rev.${sha.substring(0, 10)}`;
result-encoding: string
- name: Create versioned storybook for chromatic
run: STORYBOOK_COMPONENTS_VERSION=${{ steps.version.outputs.result }} yarn build:storybook
- name: Publish to Chromatic
id: chromatic-publish
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
storybookBuildDir: dist/storybook
exitOnceUploaded: true
exitZeroOnChanges: true
zip: true
onlyChanged: true
externals: '**/elements/core/styles/**/*.scss'

visual-regression:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,3 @@ jobs:
docker push $IMAGE_REPO_STORYBOOK:dev
env:
DOCKER_BUILDKIT: 1

- name: Generate chromatic stories
run: yarn generate:chromatic-stories
- name: Create versioned storybook for chromatic
run: STORYBOOK_COMPONENTS_VERSION="${{ steps.version.outputs.version }}" yarn build:storybook
env:
CHROMATIC: true
# Send storybook to chromatic. These snapshots should be accepted as new
# baseline in storybook.
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
storybookBuildDir: dist/storybook
autoAcceptChanges: true
exitZeroOnChanges: true
zip: true

0 comments on commit 852c3c7

Please sign in to comment.