2024-04-26 15:25:07 +00:00
|
|
|
# Triggers after the playwright tests have finished,
|
|
|
|
# taking the artifact and uploading it to Netlify for easier viewing
|
|
|
|
name: Upload End to End Test report to Netlify
|
|
|
|
on:
|
|
|
|
workflow_run:
|
|
|
|
workflows: ["End to End Tests"]
|
|
|
|
types:
|
|
|
|
- completed
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }}
|
|
|
|
cancel-in-progress: ${{ github.event.workflow_run.event == 'pull_request' }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
report:
|
2024-05-14 14:55:12 +00:00
|
|
|
if: github.event.workflow_run.conclusion != 'cancelled'
|
2024-04-26 15:25:07 +00:00
|
|
|
name: Report results
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment: Netlify
|
|
|
|
permissions:
|
|
|
|
statuses: write
|
|
|
|
deployments: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
cache: "yarn"
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Download blob reports from GitHub Actions Artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
|
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
|
|
pattern: all-blob-reports-*
|
|
|
|
path: all-blob-reports
|
|
|
|
merge-multiple: true
|
|
|
|
|
|
|
|
- name: Merge into HTML Report
|
2024-05-10 10:01:08 +00:00
|
|
|
run: yarn playwright merge-reports --reporter=html,./playwright/flaky-reporter.ts ./all-blob-reports
|
2024-04-26 15:25:07 +00:00
|
|
|
env:
|
|
|
|
# Only pass creds to the flaky-reporter on main branch runs
|
|
|
|
GITHUB_TOKEN: ${{ github.event.workflow_run.head_branch == 'develop' && secrets.ELEMENT_BOT_TOKEN || '' }}
|
|
|
|
|
|
|
|
- name: Upload HTML report
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: html-report--attempt-${{ github.run_attempt }}
|
|
|
|
path: playwright-report
|
|
|
|
retention-days: 14
|
|
|
|
|
|
|
|
- name: 📤 Deploy to Netlify
|
|
|
|
uses: matrix-org/netlify-pr-preview@v3
|
|
|
|
with:
|
|
|
|
path: playwright-report
|
|
|
|
owner: ${{ github.event.workflow_run.head_repository.owner.login }}
|
|
|
|
branch: ${{ github.event.workflow_run.head_branch }}
|
|
|
|
revision: ${{ github.event.workflow_run.head_sha }}
|
|
|
|
token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
site_id: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
desc: Playwright Report
|
|
|
|
deployment_env: EndToEndTests
|
|
|
|
prefix: "e2e-"
|