Skip to content

ci: deploy e2e report to firebase #2246

ci: deploy e2e report to firebase

ci: deploy e2e report to firebase #2246

Workflow file for this run

name: ⚙️ E2E tests
on:
pull_request:
jobs:
e2e:
name: E2E
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]
- uses: taiga-family/ci/actions/setup/[email protected]
- run: npx nx prerender editor-demo -c development
- uses: taiga-family/ci/actions/run/[email protected]
with:
port: ${{ env.NG_SERVER_PORT }}
directory: ${{ env.DIST }}
- run: npx nx e2e editor-demo-playwright -- --update-snapshots
- uses: taiga-family/ci/actions/run/[email protected]
with:
branch: snapshots/demo/next/${{ github.base_ref }}
destination: ${{ env.DIST_NEXT }}
- uses: taiga-family/ci/actions/run/[email protected]
with:
port: ${{ env.NG_SERVER_PORT }}
directory: ${{ env.DIST_NEXT }}
replaceBaseUrlFrom: './'
replaceBaseUrlTo: '/'
- run: npx nx e2e editor-demo-playwright
continue-on-error: true
- 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 }}
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
!./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
- name: Check if diff-output exists
id: diff_checker
run: |
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 ! -path '*retry*' -iname '*-diff.png' -exec echo "{}" \;
exit 1
- name: Find Comment
if: ${{ always() }}
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Build output
- name: Create or update comment
if: ${{ always() }}
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Build output
artifact-id: ${{ steps.artifact.outputs.artifact-id }}
artifact-url: ${{ steps.artifact.outputs.artifact-url }}
edit-mode: replace
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true