Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/Install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Install"

on:
schedule:
- cron: '7 7 * * *' # At 07:07 every day
workflow_dispatch:

permissions:
contents: read

jobs:
scratch:
name: "Install"
runs-on: ubuntu-latest
steps:

- name: "PHP: setup 8.4"
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
coverage: none
tools: composer

- name: "Composer: require"
run: composer require --dev playwright-php/playwright

- name: "Composer: show"
run: composer show -i "playwright-php/playwright"

- name: "Playwright Install"
run: vendor/bin/playwright-install --help
19 changes: 17 additions & 2 deletions bin/install-server → bin/playwright-install
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,22 @@
* Installs Node.js dependencies for the Playwright server using Symfony Process
*/

require_once __DIR__.'/../vendor/autoload.php';
$possibleFiles = [__DIR__.'/../../../autoload.php', __DIR__.'/../../autoload.php', __DIR__.'/../vendor/autoload.php'];
$file = null;

foreach ($possibleFiles as $possibleFile) {
if (file_exists($possibleFile)) {
$file = $possibleFile;

break;
}
}

if (null === $file) {
throw new RuntimeException('Unable to locate autoload.php file.');
}

require_once $file;

use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -260,7 +275,7 @@ $help = \in_array('-h', $_SERVER['argv'] ?? [], true)
if ($help) {
echo "Playwright Server Installer\n";
echo "\n";
echo "Usage: bin/install-server [options]\n";
echo "Usage: bin/playwright-install [options]\n";
echo "\n";
echo "Options:\n";
echo " -v, --verbose Show detailed output\n";
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,18 @@
}
},
"scripts": {
"post-install-cmd": "bin/install-server",
"install-browsers": "bin/install-server -v && npm run install-browsers --prefix bin",
"install-browsers-with-deps": "bin/install-server -v && npm run install-browsers-with-deps --prefix bin",
"post-install-cmd": "bin/playwright-install",
"install-browsers": "bin/playwright-install -v && npm run install-browsers --prefix bin",
"install-browsers-with-deps": "bin/playwright-install -v && npm run install-browsers-with-deps --prefix bin",
"cs-check": "vendor/bin/php-cs-fixer fix --dry-run --diff",
"cs-fix": "vendor/bin/php-cs-fixer fix",
"sa": "vendor/bin/phpstan analyze --memory-limit=-1",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-xml coverage",
"test:integration": "vendor/bin/phpunit --testsuite integration",
"test:unit": "vendor/bin/phpunit --testsuite unit"
}
},
"bin": [
"bin/playwright-install"
]
}
Loading