-
Notifications
You must be signed in to change notification settings - Fork 8
/
Taskfile.yml
152 lines (126 loc) · 3.81 KB
/
Taskfile.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
version: '3'
env:
UID:
sh: id -u
GID:
sh: id -g
TTY: ''
tasks:
default:
cmds:
- task --list
contribute:
desc: Contribute by running dev tools
cmds:
- task: phpcs
- task: phpstan
- task: phpmd
- task: phpunit
# Composer
composer:install:
desc: Composer install
cmds:
- docker compose run --rm $TTY php composer install {{.CLI_ARGS | default "--no-cache --no-interaction --prefer-dist"}}
composer:autoload:
desc: Composer dump autoload
cmds:
- docker compose run --rm $TTY php composer dump-autoload {{.CLI_ARGS | default "--no-cache --no-interaction"}}
composer:autoload:dev:
desc: Composer dump autoload dev
cmds:
- task composer:autoload -- --dev --no-cache --no-interaction
composer:require:
desc: Composer require package
summary: |
task composer:require p="my/package"
vars:
PACKAGE: '{{.p}}'
cmds:
- docker compose run --rm $TTY php composer require {{.PACKAGE}} {{.CLI_ARGS | default "--no-cache"}}
composer:remove:
desc: Composer remove package
summary: |
task composer:remove p="my/package"
vars:
PACKAGE: '{{.p}}'
cmds:
- docker compose run --rm $TTY php composer remove {{.PACKAGE}} {{.CLI_ARGS | default "--no-cache"}}
composer:update:
desc: Composer update package
summary: |
task composer:update p="my/package"
vars:
PACKAGE: '{{.p}}'
cmds:
- docker compose run --rm $TTY php composer update {{.PACKAGE}} {{.CLI_ARGS | default "--no-cache"}}
# Git
git:hooks:
desc: Setup git hooks
silent: true
cmds:
- |
APP_HOOKS_DIR="{{.ROOT_DIR}}/.githooks"
GIT_HOOKS_DIR="{{.ROOT_DIR}}/.git/hooks"
# Create the hooks directory if it does not exist
mkdir -p "$GIT_HOOKS_DIR"
# Symlink hooks
for hook in $(ls "$APP_HOOKS_DIR"); do
chmod +x "$APP_HOOKS_DIR/$hook"
ln -sf "$APP_HOOKS_DIR/$hook" "$GIT_HOOKS_DIR/$hook"
done
printf "\033[32m%s\033[0m\n" "Git hooks installed."
# Tools
phpcs:
desc: PHPCS dry run
cmds:
- docker compose run --rm $TTY php vendor/bin/php-cs-fixer fix --dry-run -v --diff
phpcs:fix:
desc: PHPCS fix
cmds:
- docker compose run --rm $TTY php vendor/bin/php-cs-fixer fix -v
phpmd:
desc: PHPMD run
cmds:
- docker compose run --rm $TTY php vendor/bin/phpmd src/ text phpmd.xml
phpmd:strict:
desc: PHPMD run with strict argument
cmds:
- docker compose run --rm $TTY php vendor/bin/phpmd --strict src/ text phpmd.xml
phpmd:baseline:
desc: PHPMD update baseline
cmds:
- docker compose run --rm $TTY php vendor/bin/phpmd --generate-baseline src/ text phpmd.xml
phpstan:
desc: PHPStan run
cmds:
- docker compose run --rm $TTY php vendor/bin/phpstan analyse --error-format=table
phpstan:baseline:
desc: PHPStan update baseline
cmds:
- docker compose run --rm $TTY php vendor/bin/phpstan --generate-baseline
phpunit:
desc: PHPUnit run
cmds:
- docker compose run --rm $TTY php vendor/bin/phpunit
phpunit:config:
desc: PHPUnit generate config
cmds:
- docker compose run --rm $TTY php vendor/bin/phpunit --generate-configuration
rector:
desc: Rector dry run
cmds:
- docker compose run --rm $TTY php vendor/bin/rector --dry-run
rector:fix:
desc: Rector fix
cmds:
- docker compose run --rm $TTY php vendor/bin/rector
mkdocs:
desc: MkDocs build
cmds:
- docker run --rm -it -v $(pwd):/docs ghcr.io/squidfunk/mkdocs-material:9.5 build
mkdocs:live:
desc: MkDocs development server
vars:
PORT: '{{.p | default "8001"}}'
cmds:
- docker run --rm -it -p {{.PORT}}:8000 -v $(pwd):/docs ghcr.io/squidfunk/mkdocs-material:9.5