-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
91 lines (78 loc) · 2.84 KB
/
Copy pathTaskfile.yml
File metadata and controls
91 lines (78 loc) · 2.84 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
version: '3'
dotenv: ['.env.local', '.env']
vars:
DOCKER_COMPOSE: '{{.TASK_DOCKER_COMPOSE | default "docker compose"}}'
COMPOSER: '{{.DOCKER_COMPOSE}} exec phpfpm composer'
CONSOLE: '{{.DOCKER_COMPOSE}} exec phpfpm bin/console'
PHPUNIT: '{{.DOCKER_COMPOSE}} exec phpfpm bin/phpunit'
PHP_CS_FIXER: '{{.DOCKER_COMPOSE}} exec phpfpm vendor/bin/php-cs-fixer'
PHPSTAN: '{{.DOCKER_COMPOSE}} exec phpfpm vendor/bin/phpstan'
TWIG_CS_FIXER: '{{.DOCKER_COMPOSE}} exec phpfpm vendor/bin/twig-cs-fixer'
PRETTIER: '{{.DOCKER_COMPOSE}} run --rm prettier'
MARKDOWNLINT: '{{.DOCKER_COMPOSE}} run --rm markdownlint markdownlint'
tasks:
compose:
desc: 'Install Composer dependencies'
cmds:
- '{{.COMPOSER}} {{.CLI_ARGS}}'
install:
desc: 'First-time setup: start, install deps, migrate, load fixtures'
cmds:
- '{{.DOCKER_COMPOSE}} up -d'
- '{{.COMPOSER}} install'
- '{{.CONSOLE}} doctrine:database:create --if-not-exists'
- '{{.CONSOLE}} doctrine:migrations:migrate --no-interaction'
- '{{.CONSOLE}} doctrine:fixtures:load --no-interaction'
console:
desc: 'Run a Symfony console command (usage: task console -- <command>)'
cmds:
- '{{.CONSOLE}} {{.CLI_ARGS}}'
coding-standards:check:
desc: 'Check coding standards'
cmds:
- '{{.PHP_CS_FIXER}} fix --dry-run --diff'
- '{{.TWIG_CS_FIXER}} lint'
- "{{.PRETTIER}} 'assets/**/*.js' --check"
- "{{.PRETTIER}} 'assets/**/*.{css,scss}' --check"
- "{{.PRETTIER}} '**/*.{yml,yaml}' --check"
- "{{.MARKDOWNLINT}} '**/*.md'"
coding-standards:apply:
desc: 'Apply coding standards'
cmds:
- '{{.PHP_CS_FIXER}} fix'
- '{{.TWIG_CS_FIXER}} lint --fix'
- "{{.PRETTIER}} 'assets/**/*.js' --write"
- "{{.PRETTIER}} 'assets/**/*.{css,scss}' --write"
- "{{.PRETTIER}} '**/*.{yml,yaml}' --write"
- "{{.MARKDOWNLINT}} '**/*.md' --fix"
static-analysis:
desc: 'Run PHPStan static analysis'
cmds:
- '{{.PHPSTAN}} analyse --memory-limit=1G'
test:setup:
desc: 'Create the test database, run migrations and load fixtures'
cmds:
- '{{.DOCKER_COMPOSE}} exec phpfpm composer run test-setup'
test:
desc: 'Run the PHPUnit test suite'
cmds:
- '{{.PHPUNIT}} {{.CLI_ARGS}}'
test:coverage:
desc: 'Run tests with coverage and enforce the 100% gate'
cmds:
- '{{.DOCKER_COMPOSE}} exec -e XDEBUG_MODE=coverage phpfpm composer run test-coverage'
create-admin:
desc: 'Create (or update) an administrator (usage: task create-admin -- you@example.com "Your Name")'
cmds:
- '{{.CONSOLE}} app:create-admin {{.CLI_ARGS}}'
ci:
desc: 'Run everything CI runs'
cmds:
- task: coding-standards:check
- task: static-analysis
- task: test:setup
- task: test:coverage
default:
cmds:
- task --list
silent: true