mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
feat: install media pack on windows with npx playwright install-deps
(#6836)
Chromium on Windows requires Media Pack to be installed. This patch moves media pack installation under the `npx playwright install-deps` umbrella.
This commit is contained in:
parent
2fde9bc13f
commit
17b6f06b98
16
.github/workflows/tests_secondary.yml
vendored
16
.github/workflows/tests_secondary.yml
vendored
@ -85,9 +85,6 @@ jobs:
|
||||
browser: [chromium, firefox, webkit]
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install Media Pack
|
||||
shell: powershell
|
||||
run: Install-WindowsFeature Server-Media-Foundation
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
@ -222,9 +219,6 @@ jobs:
|
||||
name: "Chrome Stable (Win)"
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install Media Pack
|
||||
shell: powershell
|
||||
run: Install-WindowsFeature Server-Media-Foundation
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
@ -302,9 +296,6 @@ jobs:
|
||||
name: "Firefox Stable (Win)"
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install Media Pack
|
||||
shell: powershell
|
||||
run: Install-WindowsFeature Server-Media-Foundation
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
@ -313,6 +304,7 @@ jobs:
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
- run: npm run build
|
||||
- run: node lib/cli/cli install-deps chromium
|
||||
- run: node lib/cli/cli install firefox-stable chromium
|
||||
- run: npm run ftest
|
||||
shell: bash
|
||||
@ -355,9 +347,6 @@ jobs:
|
||||
name: "Edge Stable (Win)"
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Install Media Pack
|
||||
shell: powershell
|
||||
run: Install-WindowsFeature Server-Media-Foundation
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
@ -409,9 +398,6 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Media Pack
|
||||
shell: powershell
|
||||
run: Install-WindowsFeature Server-Media-Foundation
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12
|
||||
|
1
bin/install_media_pack.ps1
Normal file
1
bin/install_media_pack.ps1
Normal file
@ -0,0 +1 @@
|
||||
Install-WindowsFeature Server-Media-Foundation
|
@ -16,15 +16,27 @@
|
||||
|
||||
import childProcess from 'child_process';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import { getUbuntuVersion } from '../utils/ubuntuVersion';
|
||||
import * as utils from '../utils/utils';
|
||||
|
||||
const { deps } = require('../nativeDeps');
|
||||
|
||||
const SCRIPTS_DIRECTORY = path.join(__dirname, '..', '..', 'bin');
|
||||
|
||||
export async function installDeps(browserTypes: string[]) {
|
||||
if (os.platform() !== 'linux')
|
||||
return;
|
||||
if (!browserTypes.length)
|
||||
browserTypes = ['chromium', 'firefox', 'webkit'];
|
||||
if (os.platform() === 'win32') {
|
||||
if (browserTypes.includes('chromium')) {
|
||||
const {code} = await utils.spawnAsync('powershell.exe', [path.join(SCRIPTS_DIRECTORY, 'install_media_pack.ps1')], { cwd: SCRIPTS_DIRECTORY, stdio: 'inherit' });
|
||||
if (code !== 0)
|
||||
throw new Error('Failed to install windows dependencies!');
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (os.platform() !== 'linux')
|
||||
return;
|
||||
browserTypes.push('tools');
|
||||
|
||||
const ubuntuVersion = await getUbuntuVersion();
|
||||
|
Loading…
x
Reference in New Issue
Block a user