Skip to content

Commit

Permalink
Use waiting method instead of deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Dec 3, 2024
1 parent 6f39f94 commit ea298f2
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@ on:
push:
branches:
- main
deployment_status:
pull_request:
branches:
- main
# paths:
# - "stories/**"
# - "packages/**"
# - "website/**"

jobs:
playwright:
name: Playwright Tests with Chromatic on ${{ github.event.deployment_status.environment }}
if: github.event.deployment_status.state == 'success'
name: Playwright Tests
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.49.0-jammy
steps:
- name: Output Run Number
run: echo "RUN_ID=${{ github.run_number }}" >> $GITHUB_OUTPUT
- name: Wait for Deployment
uses: patrickedqvist/[email protected]
id: deployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 600

- uses: actions/checkout@v4
with:
Expand All @@ -36,7 +45,7 @@ jobs:
- name: Run Playwright Tests
run: npx playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
PLAYWRIGHT_TEST_BASE_URL: ${{ steps.deployment.outputs.url }}

- uses: actions/upload-artifact@v4
if: always()
Expand Down Expand Up @@ -71,7 +80,8 @@ jobs:
path: ./playwright-report

- name: Run Chromatic
uses: FormidableLabs/chromaui-action@latest
env: CHROMATIC_ARCHIVE_LOCATION=./playwright-report
uses: chromaui/action@latest
with:
playwright: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
Expand Down

0 comments on commit ea298f2

Please sign in to comment.