Skip to content

Commit

Permalink
chore(SLB-506): enabling playwright with chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
elistone committed Dec 10, 2024
1 parent 30e804c commit 0f78c6d
Show file tree
Hide file tree
Showing 31 changed files with 634 additions and 69 deletions.
45 changes: 31 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,54 @@ jobs:
run: cat /tmp/preview.log || true
if: always()

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: tests/e2e/playwright-report/
retention-days: 3
- name: Check for Chromatic Storybook project token
id: chromatic-storybook-check
shell: bash
run: |
if [ "${{ secrets.CHROMATIC_STORYBOOK_PROJECT_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Check for Chromatic project token
id: chromatic-check
- name: Check for Chromatic Playwright project token
id: chromatic-playwright-check
shell: bash
run: |
if [ "${{ secrets.CHROMATIC_PROJECT_TOKEN }}" != '' ]; then
if [ "${{ secrets.CHROMATIC_PLAYWRIGHT_PROJECT_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Publish to Chromatic
uses: chromaui/action@v11
- name: Publish Playwright to Chromatic
id: chromatic-playwright
uses: chromaui/action@latest
with:
playwright: true
projectToken: ${{ secrets.CHROMATIC_PLAYWRIGHT_PROJECT_TOKEN }}
workingDir: tests/e2e/
env:
CHROMATIC_ARCHIVE_LOCATION: ./test-results-drupal
if:
${{steps.chromatic-playwright-check.outputs.available == 'true' &&
hashFiles('tests/e2e/test-results-drupal') != '' && (success() ||
failure()) }}

- name: Publish Storybook to Chromatic
id: chromatic-storybook
uses: chromaui/action@latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_STORYBOOK_PROJECT_TOKEN }}
storybookBuildDir: packages/ui/storybook-static
storybookBaseDir: packages/ui
onlyChanged: true
exitOnceUploaded: true
externals: |
static/stories/webforms/**
if:
${{ steps.chromatic-check.outputs.available == 'true' &&
${{ steps.chromatic-storybook-check.outputs.available == 'true' &&
github.ref != 'refs/heads/dev' }}

- name: Deploy storybook to netlify
Expand Down
Loading

0 comments on commit 0f78c6d

Please sign in to comment.