Skip to content

Commit

Permalink
devops: use azcopy for better upload performance (#26360)
Browse files Browse the repository at this point in the history
The credentials are created with 
`az ad sp create-for-rbac --name "playwright-github-actions" --role
"Storage Blob Data Contributor" --scopes /subscriptions/<subscription
id>/resourceGroups/<resource
group>/providers/Microsoft.Storage/storageAccounts/<storage account>`

We cannot use `azure/login@v1` for login as it does not see to properly
propagate credentials to `azcopy` in the next step (there are some
reports about keyring problems on linux based actions).
  • Loading branch information
yury-s authored Aug 9, 2023
1 parent 65ac0d5 commit ff0aef3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/create_test_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ jobs:
- name: Upload HTML report to Azure
run: |
REPORT_DIR='run-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}-${{ github.sha }}'
az storage blob upload-batch -s playwright-report -d "\$web/$REPORT_DIR" --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
azcopy login --service-principal --application-id ${{ secrets.AZURE_CLIENT_ID }} --tenant-id ${{ secrets.AZURE_TENANT_ID }}
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"
env:
AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}'

- name: Read pull request number
uses: ./.github/actions/download-artifact
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@ jobs:
- name: Upload HTML report to Azure
run: |
REPORT_DIR='run-service-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}'
az storage blob upload-batch -s playwright-report -d "\$web/$REPORT_DIR" --connection-string "${{ secrets.AZURE_CONNECTION_STRING_FOR_BLOB_REPORT }}"
azcopy login --service-principal --application-id ${{ secrets.AZURE_CLIENT_ID }} --tenant-id ${{ secrets.AZURE_TENANT_ID }}
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#?q=s:failed"
env:
AZCOPY_SPA_CLIENT_SECRET: '${{ secrets.AZURE_CLIENT_SECRET }}'

0 comments on commit ff0aef3

Please sign in to comment.