-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
111 lines (94 loc) · 3.79 KB
/
Copy pathTaskfile.yml
File metadata and controls
111 lines (94 loc) · 3.79 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
# https://taskfile.dev
version: "3"
tasks:
compose:
cmds:
- docker compose {{.TASK_ARGS}} {{.CLI_ARGS}}
internal: true
composer:
desc: Run composer inside docker compose setup, e.g. `task {{.TASK}} -- install`
cmds:
- task: compose
vars:
TASK_ARGS: run --rm phpfpm composer {{.TASK_ARGS}}
composer:install:
desc: Run composer inside docker compose setup, e.g. `task {{.TASK}} -- install`
cmds:
- rm -fr composer.lock vendor
- |
# Create a temporary composer file to install https://github.com/mglaman/composer-drupal-lenient before the real install needs it.
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer init --no-interaction
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm composer require mglaman/composer-drupal-lenient
docker compose run --rm --env COMPOSER=composer.lenient.json phpfpm rm composer.lenient.*
- task: composer
vars:
TASK_ARGS: install
coding-standards:apply:
desc: "Apply coding standards"
cmds:
- task: coding-standards:markdown:apply
- task: coding-standards:php:apply
- task: coding-standards:twig:apply
- task: coding-standards:yaml:apply
silent: true
coding-standards:check:
desc: "Apply coding standards"
cmds:
- task: coding-standards:markdown:check
- task: coding-standards:php:check
- task: coding-standards:twig:check
- task: coding-standards:yaml:check
silent: true
coding-standards:markdown:apply:
desc: "Apply coding standards for Markdown"
cmds:
# Cf. .github/workflows/markdown.yaml
- docker compose run --rm markdownlint markdownlint '**/*.md' --fix
coding-standards:markdown:check:
desc: "Apply and check coding standards for Markdown"
cmds:
- task: coding-standards:markdown:apply
# Cf. .github/workflows/markdown.yaml
- docker compose run --rm markdownlint markdownlint '**/*.md'
coding-standards:php:apply:
desc: "Apply coding standards for PHP"
cmds:
# Cf. .github/workflows/php.yaml
- docker compose run --rm phpfpm vendor/bin/phpcbf
silent: true
coding-standards:php:check:
desc: "Apply and check coding standards for PHP"
cmds:
- task: coding-standards:php:apply
# Cf. .github/workflows/php.yaml
- docker compose run --rm phpfpm vendor/bin/phpcs
silent: true
coding-standards:twig:apply:
desc: "Apply coding standards for Twig"
cmds:
- docker compose run --rm phpfpm vendor/bin/twig-cs-fixer fix
silent: true
coding-standards:twig:check:
desc: "Apply and check coding standards for Twig"
cmds:
- task: coding-standards:twig:apply
- docker compose run --rm phpfpm vendor/bin/twig-cs-fixer lint
silent: true
coding-standards:yaml:apply:
desc: "Apply coding standards for YAML"
cmds:
# Cf. .github/workflows/yaml.yaml
- docker compose run --rm prettier '**/*.{yml,yaml}' --write
coding-standards:yaml:check:
desc: "Apply coding standards for YAML"
cmds:
- task: coding-standards:yaml:apply
# Cf. .github/workflows/yaml.yaml
- docker compose run --rm prettier '**/*.{yml,yaml}' --check
test:
cmds:
- docker compose run --env PHP_XDEBUG_MODE --env PHP_XDEBUG_WITH_REQUEST --env PHP_IDE_CONFIG --rm phpfpm vendor/bin/phpunit {{.CLI_ARGS}}
xdebug:test:
cmds:
- PHP_XDEBUG_MODE=debug PHP_XDEBUG_WITH_REQUEST=yes PHP_IDE_CONFIG=serverName=localhost docker compose run --env PHP_XDEBUG_MODE --env PHP_XDEBUG_WITH_REQUEST --env PHP_IDE_CONFIG --rm phpfpm vendor/bin/phpunit {{.CLI_ARGS}}