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:
Andrey Lushnikov 2021-06-02 10:47:10 -07:00 committed by GitHub
parent 2fde9bc13f
commit 17b6f06b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 17 deletions

View File

@ -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

View File

@ -0,0 +1 @@
Install-WindowsFeature Server-Media-Foundation

View File

@ -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();