-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathTaskfile.yml
146 lines (127 loc) · 4.27 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
version: 3
env:
REPOSITORY: alma-monthlypayments-magento2
HOST_UID:
sh: id -u
HOST_GID:
sh: id -g
tasks:
default:
silent: true
cmds:
- task -l
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
docker:build:
desc: Build magento docker image
cmds:
- docker compose build magento
test:
desc: Run Unit Tests with coverage
deps:
- docker:build
cmds:
- docker compose run --rm magento ./vendor/phpunit/phpunit/phpunit -c app/code/Alma/MonthlyPayments/Test/Unit/phpunit.ci.xml --coverage-text
test-local:
desc: Run Unit Tests with coverage
deps:
- docker:build
cmds:
- docker compose run --rm magento ./vendor/phpunit/phpunit/phpunit -c app/code/Alma/MonthlyPayments/Test/phpunit.xml.dist --coverage-text
dist:
desc: Build the zip file of the module
deps:
- clean
cmds:
- ./scripts/build-dist.sh
clean:
desc: Remove the dist folder
cmds:
- rm -rf ./dist
lint:
desc: Run linter
cmds:
- docker compose run -T --rm magento composer exec phpcs -- --standard=Magento2 ./app/code/Alma/MonthlyPayments/
lint:fix:
desc: Run linter and apply fixes
cmds:
- docker compose run -T --rm magento composer exec php-cs-fixer -- fix ./app/code/Alma/MonthlyPayments/
crowdin:
internal: true
preconditions:
- sh: which crowdin
msg: Crowdin CLI is required
crowdin:download:
desc: Download translations from Crowdin
deps:
- crowdin
cmds:
- crowdin download
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