playwright/.github/workflows/tests_service.yml
Dmitry Gozman d92fe16b76
fix(blob report): default location relative to package.json (#24481)
Also:
- remove `blob-report` directory at the start;
- markdown's `report.md` next to package.json;
- use default location in playwright's workflows.

References #24451.
2023-07-28 15:49:31 -07:00

71 lines
2.5 KiB
YAML

name: "tests service"
on:
workflow_dispatch:
env:
FORCE_COLOR: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
jobs:
test:
name: "Service"
strategy:
fail-fast: false
matrix:
service-os: [linux, windows]
browser: [chromium, firefox, webkit]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test -- --project=${{ matrix.browser }} --workers=10 --retries=0
env:
PWTEST_MODE: service2
PWTEST_BLOB_SUFFIX: "-${{ matrix.service-os }}-service"
PLAYWRIGHT_SERVICE_ACCESS_KEY: ${{ secrets.PLAYWRIGHT_SERVICE_ACCESS_KEY }}
PLAYWRIGHT_SERVICE_URL: ${{ secrets.PLAYWRIGHT_SERVICE_URL }}
PLAYWRIGHT_SERVICE_OS: ${{ matrix.service-os }}
PLAYWRIGHT_SERVICE_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}-${{ github.sha }}
- name: Zip blob report
if: always()
run: zip -r ../blob-report-${{ matrix.browser }}-${{ matrix.service-os }}.zip .
working-directory: blob-report
- name: Upload blob report to GitHub
if: always()
uses: actions/upload-artifact@v3
with:
name: blob-report-${{ github.run_attempt }}
path: blob-report-${{ matrix.browser }}-${{ matrix.service-os }}.zip
retention-days: 2
merge_reports:
name: "Merge reports"
needs: [test]
if: always()
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm ci
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
- run: npm run build
- name: Download blob report artifact
uses: actions/download-artifact@v3
with:
name: blob-report-${{ github.run_attempt }}
path: blob-report-zips
- name: Unzip all blob reports
run: unzip -o 'blob-report-zips/blob-report-*.zip' -d blob-report
- run: npx playwright merge-reports --reporter markdown,html ./blob-report
- 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 }}"
echo "Report url: https://mspwblobreport.z1.web.core.windows.net/$REPORT_DIR/index.html#?q=s:failed"