chore: extract batch download action (#23410)

This commit is contained in:
Yury Semikhatsky 2023-05-31 16:07:29 -07:00 committed by GitHub
parent 40581ed906
commit 90aa378e8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 30 deletions

View file

@ -0,0 +1,23 @@
name: 'Download blob report from Azure'
description: 'Download blob report from Azure blob storage'
inputs:
run_dir:
description: 'Name of the Azure blob storage directory containing blob report'
required: true
type: string
connection_string:
description: 'Azure connection string'
required: true
type: string
runs:
using: "composite"
steps:
- name: Download blob report from Azure
shell: bash
run: |
mkdir -p ${{ inputs.run_dir }}
LIST=$(az storage blob list -c '$web' --prefix ${{ inputs.run_dir }} --connection-string "${{ inputs.connection_string }}")
for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');
do
az storage blob download -c '$web' --name $name -f $name --connection-string "${{ inputs.connection_string }}"
done

View file

@ -82,19 +82,15 @@ jobs:
DEBUG: pw:install
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- name: Download Blob Reports from Azure Blob Storage
run: |
run_dir='run-${{ github.run_id }}-${{ github.sha }}-test_linux'
mkdir -p $run_dir
LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")
for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');
do
az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
done
- name: Download blob report from Azure
uses: ./.github/actions/download-blob-report-from-azure
with:
run_dir: 'run-${{ github.run_id }}-${{ github.sha }}-test_linux'
connection_string: '${{ secrets.AZURE_CONNECTION_STRING }}'
- name: Merge into HTML Report
run: |
npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-test_linux'
- name: Upload HTML Report to Azure Blob Storage
- name: Upload HTML Report to Azure
run: |
az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_linux' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-test_linux/index.html"
@ -227,19 +223,15 @@ jobs:
DEBUG: pw:install
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- name: Download Blob Reports from Azure Blob Storage
run: |
run_dir='run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'
mkdir -p $run_dir
LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")
for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');
do
az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
done
- name: Download blob report from Azure
uses: ./.github/actions/download-blob-report-from-azure
with:
run_dir: 'run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'
connection_string: '${{ secrets.AZURE_CONNECTION_STRING }}'
- name: Merge into HTML Report
run: |
npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-test_test_runner'
- name: Upload HTML Report to Azure Blob Storage
- name: Upload HTML report to Azure
run: |
az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-test_test_runner/index.html"

View file

@ -229,19 +229,15 @@ jobs:
DEBUG: pw:install
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- name: Download Blob Reports from Azure Blob Storage
run: |
run_dir='run-${{ github.run_id }}-${{ github.sha }}-tracing_linux'
mkdir -p $run_dir
LIST=$(az storage blob list -c '$web' --prefix $run_dir --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}")
for name in $(echo $LIST | jq --raw-output '.[].name | select(test(".jsonl$"))');
do
az storage blob download -c '$web' --name $name -f $name --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
done
- name: Download blob report from Azure
uses: ./.github/actions/download-blob-report-from-azure
with:
run_dir: 'run-${{ github.run_id }}-${{ github.sha }}-tracing_linux'
connection_string: '${{ secrets.AZURE_CONNECTION_STRING }}'
- name: Merge into HTML Report
run: |
npx playwright merge-reports --reporter html --attachments missing 'run-${{ github.run_id }}-${{ github.sha }}-tracing_linux'
- name: Upload HTML Report to Azure Blob Storage
- name: Upload HTML report to Azure
run: |
az storage blob upload-batch -s playwright-report -d '$web/run-${{ github.run_id }}-${{ github.sha }}-tracing_linux' --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/run-${{ github.run_id }}-${{ github.sha }}-tracing_linux/index.html"