참고소스 수정본
This commit is contained in:
95
참고/playwright-main/.github/actions/run-test/action.yml
vendored
Normal file
95
참고/playwright-main/.github/actions/run-test/action.yml
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
name: 'Run browser tests'
|
||||
description: 'Run browser tests'
|
||||
inputs:
|
||||
command:
|
||||
description: 'Command to run tests'
|
||||
required: true
|
||||
node-version:
|
||||
description: 'Node.js version to use'
|
||||
required: false
|
||||
default: '20'
|
||||
browsers-to-install:
|
||||
description: 'Browser to install. Default is all browsers.'
|
||||
required: false
|
||||
default: ''
|
||||
bot-name:
|
||||
description: 'Bot name'
|
||||
required: true
|
||||
shard-index:
|
||||
description: 'Shard index (optional)'
|
||||
required: false
|
||||
default: '0'
|
||||
shell:
|
||||
description: 'Shell to use'
|
||||
required: false
|
||||
default: 'bash'
|
||||
flakiness-client-id:
|
||||
description: 'Azure Flakiness Dashboard Client ID'
|
||||
required: false
|
||||
flakiness-tenant-id:
|
||||
description: 'Azure Flakiness Dashboard Tenant ID'
|
||||
required: false
|
||||
flakiness-subscription-id:
|
||||
description: 'Azure Flakiness Dashboard Subscription ID'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
- uses: ./.github/actions/enable-microphone-access
|
||||
- run: |
|
||||
echo "::group::npm ci"
|
||||
npm ci
|
||||
echo "::endgroup::"
|
||||
shell: bash
|
||||
- run: |
|
||||
echo "::group::npm run build"
|
||||
npm run build
|
||||
echo "::endgroup::"
|
||||
shell: bash
|
||||
- run: |
|
||||
echo "::group::npx playwright install --with-deps"
|
||||
npx playwright install --with-deps ${{ inputs.browsers-to-install }}
|
||||
echo "::endgroup::"
|
||||
shell: bash
|
||||
- run: echo "PLAYWRIGHT_SETUP_COMPLETE=true" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
- name: Run tests
|
||||
if: inputs.shell == 'bash'
|
||||
run: |
|
||||
if [[ "$(uname)" == "Linux" ]]; then
|
||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- ${{ inputs.command }}
|
||||
else
|
||||
${{ inputs.command }}
|
||||
fi
|
||||
shell: bash
|
||||
env:
|
||||
PW_TAG: "@${{ inputs.bot-name }}"
|
||||
- name: Run tests
|
||||
if: inputs.shell != 'bash'
|
||||
run: ${{ inputs.command }}
|
||||
shell: ${{ inputs.shell }}
|
||||
env:
|
||||
PW_TAG: "@${{ inputs.bot-name }}"
|
||||
- name: Azure Login
|
||||
uses: azure/login@v2
|
||||
if: ${{ !cancelled() && env.PLAYWRIGHT_SETUP_COMPLETE == 'true' && github.event_name == 'push' && github.repository == 'microsoft/playwright' }}
|
||||
with:
|
||||
client-id: ${{ inputs.flakiness-client-id }}
|
||||
tenant-id: ${{ inputs.flakiness-tenant-id }}
|
||||
subscription-id: ${{ inputs.flakiness-subscription-id }}
|
||||
- run: |
|
||||
echo "::group::./utils/upload_flakiness_dashboard.sh"
|
||||
./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
||||
echo "::endgroup::"
|
||||
if: ${{ !cancelled() && env.PLAYWRIGHT_SETUP_COMPLETE == 'true' }}
|
||||
shell: bash
|
||||
- name: Upload blob report
|
||||
if: ${{ !cancelled() && env.PLAYWRIGHT_SETUP_COMPLETE == 'true' && (github.event_name == 'pull_request' || failure()) }}
|
||||
uses: ./.github/actions/upload-blob-report
|
||||
with:
|
||||
report_dir: blob-report
|
||||
job_name: ${{ inputs.bot-name }}-${{ inputs.shard-index }}
|
||||
Reference in New Issue
Block a user