-
Notifications
You must be signed in to change notification settings - Fork 4
/
Taskfile.yml
133 lines (117 loc) · 4.07 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
version: 3
env:
PHP_VERSION: '{{ .PHP_VERSION | default "7.4" }}'
WC_VERSION: '{{ .WC_VERSION | default "8.2.2" }}'
WP_VERSION: '{{ .WP_VERSION | default "6.4.1" }}'
REPOSITORY: alma-woocommerce-gateway
tasks:
build:test:
desc: Build test container
cmds:
- docker compose build test
build:php5-6:
desc: Build test container
cmds:
- docker compose build --build-arg UID="$(id -u)" php5-6
test:
desc: Run tests
deps:
- build:test
cmds:
- docker compose run --rm test
- docker compose down --remove-orphans
pre-commit:install:
desc: Install pre-commit hooks
cmds:
- pre-commit install --hook-type commit-msg
- pre-commit install
lint:
desc: Run linter
deps:
- build:php5-6
cmds:
- docker compose run --rm php5-6 php ./src/vendor/bin/phpcs --standard=src/phpcs.xml src
lint:fix:
desc: Run linter with autofix
deps:
- build:php5-6
cmds:
- docker compose run --rm php5-6 php ./src/vendor/bin/phpcbf --standard=src/phpcs.xml src
php-compatibility:
desc: Check compatibility code
deps:
- build:php5-6
cmds:
- docker compose run --rm php5-6 php ./src/vendor/bin/phpcs -d memory_limit=512M -p src --standard=PHPCompatibility -s --runtime-set testVersion 5.6-8.1 --ignore='*/vendor/*,src/build/*'
dist:
desc: Build zip file
deps:
- build:php5-6
cmds:
- rm -rf ./dist
- docker compose run --rm php5-6 ./bin/build.sh
crowdin:
internal: true
preconditions:
- sh: which crowdin
msg: Crowdin CLI is required
crowdin:download:
desc: Download translations from Crowdin
deps:
- crowdin
cmds:
- crowdin download
- ./bin/compile-translations.sh
crowdin:upload:
desc: Upload translations to Crowdin
deps:
- crowdin
cmds:
- crowdin upload sources
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