-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
100 lines (83 loc) · 2.49 KB
/
Copy pathTaskfile.yml
File metadata and controls
100 lines (83 loc) · 2.49 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
version: '3'
# Build/dev task runner for the SilverStripe Sweeper module.
# Install Task: https://taskfile.dev/installation
vars:
COMPOSE: docker compose -f .docker/compose.yml
tasks:
docker-env:
desc: Generate .docker/.env with deterministic ports (only if missing)
cmds:
- .docker/env.sh
status:
- test -f .docker/.env
up:
desc: Start services (build if needed)
deps: [docker-env]
cmds:
- "{{.COMPOSE}} up -d --build"
- 'echo "\n Testbed running at https://localhost:$(grep WEB_PORT .docker/.env | cut -d= -f2)\n"'
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
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:
- task: test-unit
- task: test-integration
test-unit:
desc: Run PHP unit tests
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpunit --testsuite unit"
test-integration:
desc: Run PHP integration tests
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpunit --testsuite integration"
coverage:
desc: Run tests with coverage (HTML + Clover)
deps: [ensure-up]
cmds:
- >-
{{.COMPOSE}} exec app vendor/bin/phpunit
--coverage-html coverage/html
--coverage-clover coverage/clover.xml
analyse:
desc: Run PHPStan static analysis
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpstan analyse -c phpstan.neon.dist --memory-limit=512M"
lint:
desc: Run phpcs (PSR-12) against module source
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpcs --standard=/module/phpcs.xml.dist /module/src"
lint-fix:
desc: Auto-fix coding standard violations (phpcbf)
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/phpcbf --standard=/module/phpcs.xml.dist /module/src"
flush:
desc: Clear SilverStripe cache
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/sake flush"
dev-build:
desc: Run dev/build to rebuild database and manifest
deps: [ensure-up]
cmds:
- "{{.COMPOSE}} exec app vendor/bin/sake dev/build flush=1"