-
Notifications
You must be signed in to change notification settings - Fork 475
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
4 changed files
with
29 additions
and
20 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
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,7 +17,7 @@ jobs: | |
- uses: taiga-family/ci/actions/setup/[email protected] | ||
|
||
- name: Building demo-app of git-branch without cache | ||
run: npx nx build demo | ||
run: npx nx prerender demo | ||
|
||
- name: Upload cache / ${{ env.CACHE_DIST_KEY }} | ||
uses: actions/cache/[email protected] | ||
|
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 |
---|---|---|
|
@@ -10,37 +10,26 @@ on: | |
description: update main snapshots | ||
|
||
jobs: | ||
snapshots-next: | ||
if: ${{ !contains(github.head_ref || github.ref_name, 'release/') }} | ||
name: next | ||
snapshots: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- run: npx nx build demo --output-path ${{ env.DIST_NEXT }} | ||
- run: tree ${{ env.DIST_NEXT }} -P '*.html' | ||
- run: npx nx prerender demo | ||
- run: tree ${{ env.DIST }} -P '*.html' | ||
|
||
- name: Publish next snapshots | ||
if: ${{ !contains(github.head_ref || github.ref_name, 'release/') }} | ||
uses: s0/[email protected] | ||
env: | ||
REPO: self | ||
FOLDER: ${{ env.DIST_NEXT }} | ||
FOLDER: ${{ env.DIST }} | ||
BRANCH: snapshots/demo/next/${{ github.head_ref || github.ref_name }} | ||
GITHUB_TOKEN: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} | ||
|
||
snapshots-production: | ||
if: ${{ contains(github.head_ref || github.ref_name, 'release/') || github.event.inputs.updateMain == 'true' }} | ||
name: production | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
- uses: taiga-family/ci/actions/setup/[email protected] | ||
id: nodejs-workspace | ||
|
||
- run: npx nx prerender demo | ||
- run: tree ${{ env.DIST }} -P '*.html' | ||
- name: Publish production snapshots | ||
if: ${{ contains(github.head_ref || github.ref_name, 'release/') || github.event.inputs.updateMain == 'true' }} | ||
uses: s0/[email protected] | ||
env: | ||
REPO: self | ||
|
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,19 @@ | ||
import {expect, test} from '@playwright/test'; | ||
|
||
test.describe('SSG', () => { | ||
test('has prerendered components by Angular Universal', async ({page}) => { | ||
const response = await page.goto('/'); | ||
const body = (await response?.text()) ?? ''; | ||
const prerendered = await page.evaluate( | ||
body => | ||
new DOMParser() | ||
.parseFromString(body, 'text/html') | ||
.body.querySelector('app')?.children.length ?? 0, | ||
body, | ||
); | ||
|
||
if (process.env.CI) { | ||
expect(prerendered).toBeGreaterThan(0); | ||
Check failure on line 16 in projects/demo-playwright/tests/ssg.spec.ts GitHub Actions / playwright / (8 of 8)[chromium] › tests/ssg.spec.ts:4:9 › SSG › has prerendered components by Angular Universal
Check failure on line 16 in projects/demo-playwright/tests/ssg.spec.ts GitHub Actions / playwright / (8 of 8)[chromium] › tests/ssg.spec.ts:4:9 › SSG › has prerendered components by Angular Universal
Check failure on line 16 in projects/demo-playwright/tests/ssg.spec.ts GitHub Actions / playwright / (8 of 8)[chromium] › tests/ssg.spec.ts:4:9 › SSG › has prerendered components by Angular Universal
|
||
} | ||
}); | ||
}); |