-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcastor.php
More file actions
56 lines (43 loc) · 1.37 KB
/
castor.php
File metadata and controls
56 lines (43 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
declare(strict_types=1);
/**
* This is the main castor.php for the PHPQA project itself.
*
* For examples of how to use PHPQA in your projects,
* see the examples/ directory.
*/
use Castor\Attribute\AsTask;
use function Castor\import;
use function Castor\io;
use function Castor\run;
// Import our own tasks (for testing and dogfooding)
import(__DIR__ . '/.castor/phpqa.php');
#[AsTask(description: 'Build all Docker images')]
function build(): void
{
io()->title('Building Docker images');
$versions = ['8.2', '8.3', '8.4'];
foreach ($versions as $version) {
io()->section("Building PHP $version");
run([
'docker', 'build',
'--build-arg', "PHP_VERSION=$version",
'-t', "ghcr.io/spomky-labs/phpqa:$version",
'.'
]);
}
io()->success('All images built successfully!');
}
#[AsTask(description: 'Test the migration script')]
function test_migration(string $projectPath): void
{
io()->title('Testing migration script');
run(['./scripts/migrate-project.sh', $projectPath, 'library']);
io()->success('Migration script test completed!');
}
#[AsTask(description: 'Show project structure')]
function structure(): void
{
io()->title('PHPQA Project Structure');
run(['find', '.', '-type', 'f', '-o', '-type', 'd', '|', 'grep', '-v', '\.git\|\.idea\|\.claude', '|', 'sort']);
}