-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathTaskfile.yml
164 lines (150 loc) · 4.74 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
153
154
155
156
157
158
159
160
161
162
163
164
version: 3
env:
REPOSITORY: alma-php-client
UID:
sh: id -u
GID:
sh: id -g
includes:
"5.6":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "5.6"
COMPOSE_SERVICE: php-legacy # Dockerfile needs specific APT configuration
PHPUNIT_FILE: phpunit.dist.legacy.xml
"7.0":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "7.0"
COMPOSE_SERVICE: php-legacy # Dockerfile needs specific APT configuration
"7.1":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "7.1"
COMPOSER_VERSION: "2.2" # Composer >2.2 deprecated PHP 7.1
"7.2":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "7.2"
"7.3":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "7.3"
"7.4":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "7.4"
"8.0":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "8.0"
"8.1":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "8.1"
PHPUNIT_FILE: phpunit.dist.8.xml
"8.2":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "8.2"
PHPUNIT_FILE: phpunit.dist.8.xml
"8.3":
taskfile: Taskfile.php.yml
vars:
PHP_VERSION: "8.3"
PHPUNIT_FILE: phpunit.dist.8.xml
tasks:
default:
cmds:
- cmd: task -l
silent: true
docker:down:
desc: Clean up the docker environment
cmds:
- docker compose down --volumes --remove-orphans
brew:
preconditions:
- sh: brew -v
msg: 'This task requires `brew`. Please refer to this documentation: https://brew.sh/'
pre-commit:
desc: Install pre-commit tool
internal: true
deps: [brew]
status:
- pre-commit --version
cmds:
- brew install pre-commit
pre-commit:install:
desc: Install and set up pre-commit hooks
deps: [pre-commit]
cmds:
- pre-commit install --hook-type pre-commit --hook-type commit-msg
lint:
desc: Lint the php code
deps:
- 8.3:docker:build
cmds:
- docker compose run --rm -T php composer exec phpcs -- src/
lint:fix:
desc: Lint fix the php code
deps:
- 8.3:docker:build
cmds:
- docker compose run --rm -T php composer exec phpcbf -- src/ tests/
dist:
desc: Build zip dist package using Docker
deps:
- 8.3:docker:build
cmds:
- docker compose run --rm php ./scripts/build.sh
php-compatibility:
desc: Check compatibility code
cmds:
- docker compose run --rm -T php composer exec phpcs -- -p src --standard=PHPCompatibility -s --runtime-set testVersion 5.6-8.1 --ignore=\*/vendor/\*
gh-cli:
internal: true
preconditions:
- sh: gh --version
msg: |
⚠️ This task requires `gh` (Github CLI).
Please check out: https://github.com/cli/cli#installation
You'll need a personal access token to authenticate with `gh`.
Please check out: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic
Then, run `gh auth login` or set the GITHUB_TOKEN environment variable with your personal access token.
release:
deps:
- gh-cli
desc: Create a release pull request
cmds:
- gh workflow run release-pull-request.yml
- cmd: sleep 2
silent: true
- cmd: echo "Release pull request created, check out https://github.com/alma/{{.REPOSITORY}}/pulls?q=is%3Aopen+is%3Apr+label%3Arelease"
silent: true
- cmd: echo "If no pull request is created, check out https://github.com/alma/{{.REPOSITORY}}/actions/workflows/release-pull-request.yml"
silent: true
- cmd: echo "Please, review and merge the pull request."
silent: true
- cmd: echo "After merging, the release will be automatically created."
silent: true
hotfix:
deps:
- gh-cli
desc: Create a hotfix pull request
preconditions:
- sh: test -n "{{.CHANGELOG_MESSAGE}}"
msg: |
⚠️ This task requires a changelog message.
Please provide a changelog message. Example: `task hotfix CHANGELOG_MESSAGE='This is a message'`.
cmds:
- gh workflow run hotfix-pull-request.yml -F changelog-message='{{.CHANGELOG_MESSAGE}}'
- cmd: sleep 2
silent: true
- cmd: echo "Hotfix pull request created, check out https://github.com/alma/{{.REPOSITORY}}/pulls?q=is%3Aopen+is%3Apr+label%3Ahotfix"
silent: true
- cmd: echo "If no pull request is created, check out https://github.com/alma/{{.REPOSITORY}}/actions/workflows/hotfix-pull-request.yml"
silent: true
- cmd: echo "Please, review and merge the pull request."
silent: true
- cmd: echo "After merging, the release will be automatically created."
silent: true