-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use waiting method instead of deployment
- Loading branch information
1 parent
6f39f94
commit ea298f2
Showing
1 changed file
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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() | ||
|
@@ -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 }} | ||
|