Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: also publish merge report for commits (#39364)

Simon Knott7b634d9469e1
diff --git a/.github/actions/run-test/action.yml b/.github/actions/run-test/action.yml
index e4ea163fa0..3d589e4011 100644
--- a/.github/actions/run-test/action.yml
+++ b/.github/actions/run-test/action.yml
@@ -86,8 +86,6 @@ runs:
if: ${{ !cancelled() }}
shell: bash
- name: Upload blob report
- # We only merge reports for PRs as per .github/workflows/create_test_report.yml.
- if: ${{ !cancelled() && github.event_name == 'pull_request' }}
uses: ./.github/actions/upload-blob-report
with:
report_dir: blob-report
diff --git a/.github/actions/upload-blob-report/action.yml b/.github/actions/upload-blob-report/action.yml
index e407e67573..12edf46ce1 100644
--- a/.github/actions/upload-blob-report/action.yml
+++ b/.github/actions/upload-blob-report/action.yml
@@ -1,5 +1,5 @@
name: 'Upload blob report'
-description: 'Upload blob report to GitHub artifacts (for pull requests)'
+description: 'Upload blob report to GitHub artifacts'
inputs:
report_dir:
description: 'Directory containing blob report'
@@ -16,7 +16,7 @@ runs:
shell: bash
run: find "${{ inputs.report_dir }}" -name "*.zip" -exec unzip -t {} \;
- name: Upload blob report to GitHub
- if: ${{ !cancelled() && github.event_name == 'pull_request' }}
+ if: ${{ !cancelled() && (github.event_name == 'pull_request' || job.status == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ inputs.job_name }}
diff --git a/.github/workflows/create_test_report.yml b/.github/workflows/create_test_report.yml
index cb3340277b..69e735a194 100644
--- a/.github/workflows/create_test_report.yml
+++ b/.github/workflows/create_test_report.yml
@@ -9,9 +9,10 @@ jobs:
permissions:
pull-requests: write
checks: write
+ statuses: write
id-token: write # This is required for OIDC login (azure/login) to succeed
contents: read # This is required for actions/checkout to succeed
- if: ${{ github.event.workflow_run.event == 'pull_request' }}
+ if: ${{ github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
@@ -45,9 +46,25 @@ jobs:
subscription-id: ${{ secrets.AZURE_BLOB_REPORTS_SUBSCRIPTION_ID }}
- name: Upload HTML report to Azure
+ id: upload-report
run: |
REPORT_DIR='run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}'
azcopy cp --recursive "./playwright-report/*" "https://mspwblobreport.blob.core.windows.net/\$web/$REPORT_DIR"
- echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html"
+ REPORT_URL="https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html"
+ echo "Report url: $REPORT_URL"
+ echo "reportUrl=$REPORT_URL" >> "$GITHUB_OUTPUT"
env:
AZCOPY_AUTO_LOGIN_TYPE: AZCLI
+
+ - name: Publish Report URL as Commit Status
+ uses: actions/github-script@v7
+ with:
+ script: |
+ await github.rest.repos.createCommitStatus({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ sha: '${{ github.event.workflow_run.head_sha }}',
+ state: 'success',
+ target_url: '${{ steps.upload-report.outputs.reportUrl }}',
+ context: 'HTML Report',
+ });
diff --git a/.github/workflows/tests_primary.yml b/.github/workflows/tests_primary.yml
index 6258a602d1..ab217efb10 100644
--- a/.github/workflows/tests_primary.yml
+++ b/.github/workflows/tests_primary.yml
@@ -182,7 +182,6 @@ jobs:
env:
PW_TAG: "@vscode-extension"
- name: Upload blob report
- if: ${{ !cancelled() }}
uses: ./.github/actions/upload-blob-report
with:
report_dir: playwright-vscode/blob-report