Skip to content

Commit

Permalink
ci: add e2e report
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Nov 19, 2024
1 parent 8602e4e commit 79d1c0e
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 11 deletions.
15 changes: 15 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"projects": {},
"targets": {
"taiga-previews": {
"hosting": {
"taiga-previews-demo": [
"taiga-previews-demo"
],
"taiga-previews-demo-e2e-report": [
"taiga-previews-demo-e2e-report"
]
}
}
}
}
1 change: 1 addition & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_TAIGA_PREVIEWS_SA }}
projectId: taiga-previews
target: taiga-previews-demo
expires: 1d

concurrency:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ jobs:
compression-level: 0
retention-days: 1

- name:
Upload reports / blob-reports_${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_${{ matrix.shard.os }}_${{
matrix.shard.index }}
uses: actions/[email protected]
with:
path: ./projects/demo-playwright/blob-report
name:
blob-reports_${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_${{ matrix.shard.os }}_${{ matrix.shard.index }}
compression-level: 0
retention-days: 1

# workaround for status checks -- check this one job instead of each individual E2E job in the matrix
# see https://github.com/orgs/community/discussions/9141#discussioncomment-2296809
playwright-composite-result:
Expand All @@ -213,6 +224,7 @@ jobs:
steps:
- uses: actions/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]
- uses: taiga-family/ci/actions/setup/[email protected]

- name: Download artifacts for Playwright
continue-on-error: true
Expand All @@ -232,6 +244,49 @@ jobs:
merge-multiple: true
- run: ls -R ./total/cypress || echo "not found"

- name: Download blob reports for Playwright
continue-on-error: true
uses: actions/[email protected]
with:
path: all-blob-reports
pattern: blob-reports_${{ env.PLAYWRIGHT_SNAPSHOTS_ARTIFACTS_KEY }}_*
merge-multiple: true
- run: ls -R ./all-blob-reports || echo "not found"

- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html,json ./all-blob-reports > ./all-blob-reports/results.json

- name: Deploy e2e report
id: e2e-report
uses: FirebaseExtended/[email protected]
if: env.IS_OWNER_MODE == 'true'
continue-on-error: true
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_TAIGA_PREVIEWS_SA }}
projectId: taiga-previews
expires: 1d
target: taiga-previews-demo-e2e-report
disableComment: 'true'

- name: Upload HTML report
uses: actions/[email protected]
id: upload-merged-playwright-report-step
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 1

- name: Create report comment
id: report-summary
continue-on-error: true
uses: daun/[email protected]
with:
comment-title: 'Playwright test results'
report-file: ./all-blob-reports/results.json
report-url: ${{ steps.upload-merged-playwright-report-step.outputs.artifact-url }}
custom-info: 'For more information, [see our report](${{ steps.e2e-report.outputs.details_url }})'

- name: Check if diff-output exists
id: diff_checker
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ RELEASE_BODY.md
projects/demo/routes.txt
migrations.json
sitemap.xml
blob-report
35 changes: 25 additions & 10 deletions firebase.json
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-previews-demo",
"public": "dist/demo/browser",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "taiga-previews-demo-e2e-report",
"public": "playwright-report",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
4 changes: 3 additions & 1 deletion projects/demo-playwright/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default defineConfig({
testMatch: '**/*.pw.spec.ts',
outputDir: 'tests-results',
snapshotDir: 'snapshots',
reporter: process.env.CI ? 'github' : [['html', {outputFolder: 'tests-report'}]],
reporter: process.env.CI
? [['blob'], ['github']]
: [['html', {outputFolder: 'tests-report'}]],
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
Expand Down

0 comments on commit 79d1c0e

Please sign in to comment.