|
| 1 | +name: "test runner" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - release-* |
| 8 | + pull_request: |
| 9 | + paths-ignore: |
| 10 | + - 'browser_patches/**' |
| 11 | + - 'docs/**' |
| 12 | + - 'packages/playwright-core/src/server/bidi/**' |
| 13 | + - 'packages/playwright-core/src/tools/**' |
| 14 | + - 'tests/bidi/**' |
| 15 | + - 'tests/mcp/**' |
| 16 | + branches: |
| 17 | + - main |
| 18 | + - release-* |
| 19 | + |
| 20 | +concurrency: |
| 21 | + # For pull requests, cancel all currently-running jobs for this workflow |
| 22 | + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency |
| 23 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 24 | + cancel-in-progress: true |
| 25 | + |
| 26 | +env: |
| 27 | + # Force terminal colors. @see https://www.npmjs.com/package/colors |
| 28 | + FORCE_COLOR: 1 |
| 29 | + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 |
| 30 | + |
| 31 | +jobs: |
| 32 | + test_test_runner: |
| 33 | + name: Test Runner |
| 34 | + environment: ${{ github.event_name == 'push' && 'allow-uploading-flakiness-results' || null }} |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + os: [ubuntu-latest, macos-latest] |
| 39 | + node-version: [20] |
| 40 | + shardIndex: [1, 2] |
| 41 | + shardTotal: [2] |
| 42 | + shardWeights: ['58:42'] |
| 43 | + include: |
| 44 | + - os: windows-latest |
| 45 | + node-version: 20 |
| 46 | + shardIndex: 1 |
| 47 | + shardTotal: 3 |
| 48 | + shardWeights: '44:33:23' |
| 49 | + - os: windows-latest |
| 50 | + node-version: 20 |
| 51 | + shardIndex: 2 |
| 52 | + shardTotal: 3 |
| 53 | + shardWeights: '44:33:23' |
| 54 | + - os: windows-latest |
| 55 | + node-version: 20 |
| 56 | + shardIndex: 3 |
| 57 | + shardTotal: 3 |
| 58 | + shardWeights: '44:33:23' |
| 59 | + - os: ubuntu-latest |
| 60 | + node-version: 22 |
| 61 | + shardIndex: 1 |
| 62 | + shardTotal: 2 |
| 63 | + shardWeights: '58:42' |
| 64 | + - os: ubuntu-latest |
| 65 | + node-version: 22 |
| 66 | + shardIndex: 2 |
| 67 | + shardTotal: 2 |
| 68 | + shardWeights: '58:42' |
| 69 | + - os: ubuntu-latest |
| 70 | + node-version: 24 |
| 71 | + shardIndex: 1 |
| 72 | + shardTotal: 2 |
| 73 | + shardWeights: '58:42' |
| 74 | + - os: ubuntu-latest |
| 75 | + node-version: 24 |
| 76 | + shardIndex: 2 |
| 77 | + shardTotal: 2 |
| 78 | + shardWeights: '58:42' |
| 79 | + runs-on: ${{ matrix.os }} |
| 80 | + permissions: |
| 81 | + id-token: write # This is required for OIDC login (azure/login) to succeed |
| 82 | + contents: read # This is required for actions/checkout to succeed |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v6 |
| 85 | + - uses: ./.github/actions/run-test |
| 86 | + with: |
| 87 | + node-version: ${{matrix.node-version}} |
| 88 | + command: npm run ttest -- --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} |
| 89 | + bot-name: "${{ matrix.os }}-node${{ matrix.node-version }}" |
| 90 | + shard-index: ${{ matrix.shardIndex }} |
| 91 | + flakiness-client-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_CLIENT_ID }} |
| 92 | + flakiness-tenant-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_TENANT_ID }} |
| 93 | + flakiness-subscription-id: ${{ secrets.AZURE_FLAKINESS_DASHBOARD_SUBSCRIPTION_ID }} |
| 94 | + env: |
| 95 | + PWTEST_CHANNEL: firefox-beta |
| 96 | + PWTEST_SHARD_WEIGHTS: ${{ matrix.shardWeights }} |
| 97 | + |
| 98 | + test_vscode_extension: |
| 99 | + name: VSCode Extension |
| 100 | + runs-on: ubuntu-latest |
| 101 | + steps: |
| 102 | + - uses: actions/checkout@v6 |
| 103 | + - uses: actions/setup-node@v6 |
| 104 | + with: |
| 105 | + node-version: 20 |
| 106 | + - run: npm ci |
| 107 | + env: |
| 108 | + DEBUG: pw:install |
| 109 | + - run: npm run build |
| 110 | + - run: npx playwright install chromium |
| 111 | + - name: Checkout extension |
| 112 | + run: git clone https://github.com/microsoft/playwright-vscode.git |
| 113 | + - name: Print extension revision |
| 114 | + run: git rev-parse HEAD |
| 115 | + working-directory: ./playwright-vscode |
| 116 | + - name: Remove @playwright/test from extension dependencies |
| 117 | + run: node -e "const p = require('./package.json'); delete p.devDependencies['@playwright/test']; fs.writeFileSync('./package.json', JSON.stringify(p, null, 2));" |
| 118 | + working-directory: ./playwright-vscode |
| 119 | + - name: Build extension |
| 120 | + run: npm ci && npm run build |
| 121 | + working-directory: ./playwright-vscode |
| 122 | + - name: Run extension tests |
| 123 | + run: npm run test |
| 124 | + working-directory: ./playwright-vscode |
| 125 | + env: |
| 126 | + PW_TAG: "@vscode-extension" |
| 127 | + - name: Upload blob report |
| 128 | + if: ${{ !cancelled() && (github.event_name == 'pull_request' || failure()) }} |
| 129 | + uses: ./.github/actions/upload-blob-report |
| 130 | + with: |
| 131 | + report_dir: playwright-vscode/blob-report |
| 132 | + job_name: vscode-extension |
0 commit comments