Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 14, 2024
1 parent 16352e8 commit 1075f43
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 32 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ jobs:
name: PHP:${{ matrix.php }} with PHPUnit:${{ matrix.phpunit }} on ${{ matrix.os }} (${{ matrix.dependencies }})

steps:
- name: Checkout repository and submodules
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

30 changes: 10 additions & 20 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,25 @@ $files = new Illuminate\Filesystem\Filesystem();

echo ">>>> Checkout branch {$BRANCH}".PHP_EOL;

Illuminate\Support\Collection::make([
"git checkout $BRANCH",
"git submodule init",
"git submodule foreach git reset --hard HEAD",
"git submodule foreach git checkout $BRANCH",
"git submodule foreach git pull",
])->each(function ($command) use ($workingPath) {
Symfony\Component\Process\Process::fromShellCommandline($command, $workingPath)->mustRun();
});

$files->copy("{$workingPath}/core/testbench.yaml", "{$workingPath}/testbench.yaml");
$files->copy("{$workingPath}/vendor/orchestra/testbench-core/testbench.yaml", "{$workingPath}/testbench.yaml");

Illuminate\Support\Collection::make([
...$files->glob("{$workingPath}/core/workbench/app/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/app/*"),
])->flatten()
->filter(fn ($file) => is_file($file))
->each(function ($file) use ($files, $workingPath) {
$files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/core/workbench"));
$files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/vendor/orchestra/testbench-core/workbench"));
});

Illuminate\Support\Collection::make([
...$files->glob("{$workingPath}/core/workbench/config/*.php"),
...$files->glob("{$workingPath}/core/workbench/config/*/*.php"),
...$files->glob("{$workingPath}/core/workbench/routes/*"),
...$files->glob("{$workingPath}/core/workbench/resources/lang/en/*"),
...$files->glob("{$workingPath}/core/workbench/resources/views/components/*"),
...$files->glob("{$workingPath}/core/workbench/resources/views/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/config/*.php"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/config/*/*.php"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/routes/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/resources/lang/en/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/resources/views/components/*"),
...$files->glob("{$workingPath}/vendor/orchestra/testbench-core/workbench/resources/views/*"),
])->flatten()
->filter(fn ($file) => is_file($file))
->each(function ($file) use ($files, $workingPath) {
$files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/core/workbench"));
$files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/vendor/orchestra/testbench-core/workbench"));
});
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
"phpunit/phpunit": "^8.5.21 || ^9.5.10",
"spatie/laravel-ray": "^1.29.7"
},
"config": {
"preferred-install": {
"orchestra/testbench-core": "source",
"*": "auto"
},
"sort-packages": true
},
"scripts": {
"post-autoload-dump": "@prepare",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
Expand All @@ -36,9 +43,6 @@
"@test"
]
},
"config": {
"sort-packages": true
},
"prefer-stable": true,
"minimum-stability": "dev"
}
1 change: 0 additions & 1 deletion core
Submodule core deleted from 846a9b
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</coverage>
<testsuites>
<testsuite name="Testbench Test Suite">
<directory suffix="Test.php">./core/tests/</directory>
<directory suffix="Test.php">./vendor/orchestra/testbench-core/tests/</directory>
</testsuite>
</testsuites>
<groups>
Expand Down

0 comments on commit 1075f43

Please sign in to comment.