-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
115 lines (95 loc) · 2.92 KB
/
Copy pathTaskfile.yml
File metadata and controls
115 lines (95 loc) · 2.92 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: '3'
# Build/dev task runner for the SilverStripe E2E module.
# Install Task: https://taskfile.dev/installation
vars:
COMPOSE: docker compose -f .docker/compose.yml
tasks:
docker-env:
desc: Generate deterministic per-worktree ports in .docker/.env
cmds: [.docker/env.sh]
status: [test -f .docker/.env]
up:
desc: Start services (build if needed)
deps: [docker-env]
cmds:
- "{{.COMPOSE}} up -d --build --wait"
down:
desc: Stop services
cmds:
- "{{.COMPOSE}} down"
destroy:
desc: Stop services and remove volumes
cmds:
- "{{.COMPOSE}} down -v"
build:
desc: Build images without starting
cmds:
- "{{.COMPOSE}} build"
ensure-up:
desc: Ensure services are running and ready
deps: [docker-env]
cmds:
- "{{.COMPOSE}} exec app true 2>/dev/null || {{.COMPOSE}} up -d --build --wait"
test:
desc: Run all PHP tests (unit + integration)
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpunit"
test-unit:
desc: Run PHP unit tests (no database or framework)
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpunit --testsuite unit"
test-integration:
desc: Run PHP integration tests (full SilverStripe environment)
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpunit --testsuite integration"
test-e2e:
desc: Run the Playwright E2E suite against the served app
deps: [ensure-up]
cmds:
- npx playwright test
analyse:
desc: Run PHPStan static analysis
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpstan analyse -c phpstan.neon.dist --memory-limit=512M"
analyse-php85:
desc: Run PHPStan with the analysis target pinned to PHP 8.5
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpstan analyse -c phpstan-php85.neon.dist --memory-limit=512M"
rector:
desc: Run Rector refactoring (applies changes)
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/rector process"
rector-dry:
desc: Run Rector in dry-run mode (preview only)
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/rector process --dry-run"
coverage:
desc: Run all tests with coverage (HTML + Clover XML)
deps: [ensure-up]
cmds:
- >-
{{.COMPOSE}} exec app vendor/bin/phpunit
--coverage-html coverage/html
--coverage-clover coverage/clover.xml
coverage-check:
desc: Check PHP coverage meets the 90% threshold
deps: [coverage]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/coverage-check coverage/clover.xml 90"
flush:
desc: Clear SilverStripe cache
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/sake flush"
dev-build:
desc: Run dev/build to rebuild the database and manifest
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/sake dev/build flush=1"