generated from Tinkoff/angular-open-source-starter
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
139 additions
and
45 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"projects": {}, | ||
"targets": { | ||
"taiga-editor": { | ||
"hosting": { | ||
"taiga-editor": [ | ||
"taiga-editor" | ||
], | ||
"taiga-editor-e2e-report": [ | ||
"taiga-editor-e2e-report" | ||
] | ||
} | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
name: ⚙️ Build demo | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
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,7 +4,7 @@ on: | |
branches: [main] | ||
|
||
jobs: | ||
deploy: | ||
prod: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
|
11 changes: 5 additions & 6 deletions
11
.github/workflows/deploy-preview.yml → .github/workflows/deploy-staging.yml
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
name: 🚀 Deploy / preview | ||
name: 🚀 Deploy | ||
on: pull_request | ||
|
||
jobs: | ||
build_and_preview: | ||
name: Firebase | ||
staging: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- run: npx nx build editor-demo | ||
- name: Deploy preview | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
- uses: FirebaseExtended/action-hosting-deploy@v0 | ||
continue-on-error: true | ||
if: ${{ env.IS_FORK == 'false' && env.IS_DEPENDABOT == 'false' }} | ||
with: | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TUI_EDITOR }} | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
projectId: taiga-editor | ||
target: taiga-editor | ||
expires: 1d | ||
|
||
concurrency: | ||
|
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 |
---|---|---|
|
@@ -32,22 +32,45 @@ jobs: | |
- run: npx nx e2e editor-demo-playwright | ||
continue-on-error: true | ||
|
||
- uses: actions/[email protected] | ||
- run: tree ./projects/demo-playwright/tests-results | ||
- name: Deploy e2e report | ||
uses: FirebaseExtended/action-hosting-deploy@v0 | ||
continue-on-error: true | ||
with: | ||
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TUI_EDITOR }} | ||
repoToken: ${{ secrets.GITHUB_TOKEN }} | ||
live: ${{ github.event.number }} | ||
target: taiga-editor-e2e-report | ||
projectId: taiga-editor | ||
expires: 1d | ||
|
||
- name: Upload artifacts / ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }} | ||
uses: actions/[email protected] | ||
id: artifact | ||
with: | ||
path: ./projects/demo-playwright/tests-results/**/*-diff.png | ||
path: | | ||
./projects/demo-playwright/tests-results/**/*-diff.png | ||
!./projects/demo-playwright/tests-results/**/*-retry*/*-diff.png | ||
name: ${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }} | ||
if-no-files-found: ignore | ||
compression-level: 0 | ||
retention-days: 1 | ||
|
||
- id: diff-checker | ||
- name: Check if diff-output exists | ||
id: diff_checker | ||
run: | | ||
echo "diff_exist=$(find ./projects/demo-playwright/tests-results -regex '.*diff\.png$' | wc -l | sed -e 's/^[[:space:]]*//')" >> $GITHUB_OUTPUT | ||
- if: ${{ steps.diff-checker.outputs.diff_exist != '0' }} | ||
echo "diff_exist=$(find ./projects/demo-playwright/tests-results ! -path '*retry*' -iname '*-diff.png' | wc -l | sed -e 's/^[[:space:]]*//')" >> $GITHUB_OUTPUT | ||
- name: Fall with an error if diff-output exists | ||
if: ${{ steps.diff_checker.outputs.diff_exist != '0' }} | ||
run: | | ||
find ./projects/demo-playwright/tests-results -regex '.*diff\.png$' -exec echo "{}" \; | ||
find ./projects/demo-playwright/tests-results ! -path '*retry*' -iname '*-diff.png' -exec echo "{}" \; | ||
exit 1 | ||
- uses: daun/[email protected] | ||
if: always() | ||
with: | ||
report-file: ./projects/demo-playwright/test-results.json | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true |
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
|
||
# misc | ||
/coverage | ||
test-results.json | ||
*.log | ||
|
||
# System Files | ||
|
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 |
---|---|---|
@@ -1,12 +1,27 @@ | ||
{ | ||
"hosting": { | ||
"public": "dist/demo/browser", | ||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} | ||
"$schema": "https://raw.githubusercontent.com/firebase/firebase-tools/master/schema/firebase-config.json", | ||
"hosting": [ | ||
{ | ||
"target": "taiga-editor", | ||
"public": "dist/demo/browser", | ||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
}, | ||
{ | ||
"target": "taiga-editor-e2e-report", | ||
"public": "projects/demo-playwright/tests-report", | ||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} | ||
] | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type {Page} from '@playwright/test'; | ||
import {expect} from '@playwright/test'; | ||
|
||
export async function tuiWaitForFonts(page: Page): Promise<void> { | ||
await expect(async () => { | ||
expect(await page.evaluate(() => (document as any).fonts.size)).toBeGreaterThan( | ||
0, | ||
); | ||
expect(await page.evaluate(() => (document as any).fonts.ready)).toBeTruthy(); | ||
expect(await page.evaluate(() => (document as any).fonts.status)).toBe('loaded'); | ||
}).toPass({timeout: 30_000}); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type {Locator} from '@playwright/test'; | ||
|
||
export async function waitStableState(locator: Locator): Promise<void> { | ||
try { | ||
const handle = await locator.elementHandle(); | ||
|
||
// https://playwright.dev/docs/actionability#stable | ||
// element is Stable, as in not animating or completed animation | ||
// Element is considered stable when it has maintained | ||
// the same bounding box for at least two consecutive animation frames. | ||
await handle?.waitForElementState('stable'); | ||
|
||
// https://playwright.dev/docs/actionability#visible | ||
// Element is considered visible when it has non-empty bounding box | ||
await handle?.waitForElementState('visible'); | ||
} catch {} | ||
} |