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]
|
browser: [chromium, firefox, webkit]
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Media Pack
|
|
||||||
shell: powershell
|
|
||||||
run: Install-WindowsFeature Server-Media-Foundation
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -222,9 +219,6 @@ jobs:
|
||||||
name: "Chrome Stable (Win)"
|
name: "Chrome Stable (Win)"
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Media Pack
|
|
||||||
shell: powershell
|
|
||||||
run: Install-WindowsFeature Server-Media-Foundation
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -302,9 +296,6 @@ jobs:
|
||||||
name: "Firefox Stable (Win)"
|
name: "Firefox Stable (Win)"
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Media Pack
|
|
||||||
shell: powershell
|
|
||||||
run: Install-WindowsFeature Server-Media-Foundation
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -313,6 +304,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
- run: node lib/cli/cli install-deps chromium
|
||||||
- run: node lib/cli/cli install firefox-stable chromium
|
- run: node lib/cli/cli install firefox-stable chromium
|
||||||
- run: npm run ftest
|
- run: npm run ftest
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -355,9 +347,6 @@ jobs:
|
||||||
name: "Edge Stable (Win)"
|
name: "Edge Stable (Win)"
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Media Pack
|
|
||||||
shell: powershell
|
|
||||||
run: Install-WindowsFeature Server-Media-Foundation
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -409,9 +398,6 @@ jobs:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install Media Pack
|
|
||||||
shell: powershell
|
|
||||||
run: Install-WindowsFeature Server-Media-Foundation
|
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 12
|
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 childProcess from 'child_process';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
import path from 'path';
|
||||||
import { getUbuntuVersion } from '../utils/ubuntuVersion';
|
import { getUbuntuVersion } from '../utils/ubuntuVersion';
|
||||||
|
import * as utils from '../utils/utils';
|
||||||
|
|
||||||
const { deps } = require('../nativeDeps');
|
const { deps } = require('../nativeDeps');
|
||||||
|
|
||||||
|
const SCRIPTS_DIRECTORY = path.join(__dirname, '..', '..', 'bin');
|
||||||
|
|
||||||
export async function installDeps(browserTypes: string[]) {
|
export async function installDeps(browserTypes: string[]) {
|
||||||
if (os.platform() !== 'linux')
|
|
||||||
return;
|
|
||||||
if (!browserTypes.length)
|
if (!browserTypes.length)
|
||||||
browserTypes = ['chromium', 'firefox', 'webkit'];
|
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');
|
browserTypes.push('tools');
|
||||||
|
|
||||||
const ubuntuVersion = await getUbuntuVersion();
|
const ubuntuVersion = await getUbuntuVersion();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue