forked from ansible/vscode-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
213 lines (213 loc) · 5.15 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
---
# see https://taskfile.dev/#/
version: "3"
output: prefixed # do not use "group" due to impact on CI
env: &env
FORCE_COLOR: "true"
PRE_COMMIT_COLOR: always
# basically the same thing from .envrc file:
VIRTUAL_ENV: # "{{.VIRTUAL_ENV}}"
sh: echo "${VIRTUAL_ENV:-out/venvs/{{.HOSTNAME}}}"
vars:
HOSTNAME:
sh: echo ${HOSTNAME:-${HOST:-$(hostname)}}
tasks:
default:
vars:
VERSION:
sh: node -p "require('./package.json').version"
desc: Run most commands
deps:
- install
- lint
- package
cmds:
- echo {{.TASK}}
- echo Done {{.VERSION}}!
devel:
desc: Updates the language server to latest from @main and run all tests
cmds:
- tools/clone-sibling.sh
- yarn link --relative ../ansible-language-server
- task: install
# - tools/dirty.sh
- >
bash -c 'git diff --quiet --exit-code || {
git add package.json yarn.lock &&
echo "Update ansible-language-server" |
git commit --file -
;}'
- tools/dirty.sh
- task: test
- echo "Tests passed, you can now run "task pr" to create a pull request."
clean:
desc: Clean up all files that not tracked by git
cmds:
- git clean -dxf
setup:
desc: Install dependencies
env:
# used inside test-setup.sh
OS: "{{OS}}"
ARCH: "{{ARCH}}"
cmds:
- python3 ./tools/precheck.py
- bash ./tools/test-setup.sh
sources:
- tools/test-setup.sh
generates:
- out/log/manifest-{{.HOSTNAME}}.yml
run: once
interactive: true
install:
deps:
- setup
cmds:
- yarn install
sources:
- package.json
- yarn.lock
interactive: true
build:
desc: Build the project
deps:
- install
cmds:
# Workaround for https://github.com/redhat-developer/vscode-extension-tester/pull/460#issuecomment-1166315428
# - cd node_modules/vscode-extension-tester && npm update vsce
- yarn run clean
- yarn run compile
- npx tsc -p ./
sources:
- Taskfile.yml
- node_modules/**/*
- package.json
- src/**/*
- test/**/*
- tsconfig.json
- webpack.config.ts
- yarn.lock.json
code:
env:
# https://github.com/microsoft/vscode/issues/82524#issuecomment-1150315756
NODE_OPTIONS: "--no-deprecation"
desc: Forced install of extension in your code instance
deps:
- package
cmds:
- code --force --install-extension *.vsix
deps:
desc: Update dependencies
deps:
- install
cmds:
# upgrade yarn itself
- yarn set version latest
# bumps some developments dependencies
- yarn upgrade-interactive
# running install after upgrade is needed in order to update the lock file
- yarn install
# check deps
- yarn dlx depcheck
- $VIRTUAL_ENV/bin/python3 ./tools/precheck.py
- $VIRTUAL_ENV/bin/python3 -m pre_commit autoupdate
interactive: true
lint:
desc: Lint the project
deps:
- install
cmds:
- $VIRTUAL_ENV/bin/python3 ./tools/precheck.py
- $VIRTUAL_ENV/bin/python -m pre_commit run -a
- tools/dirty.sh
silent: true
sources:
- "*.*"
- .config
- .github
- .vscode
- doc
- examples
- images
- src
- syntaxes
- test
- tools
test:
desc: Run all tests
deps:
- package
cmds:
#- task: test-ui
#- task: test-ui-old
- task: test-e2e
- tools/dirty.sh
interactive: true
test-e2e:
desc: Run e2e tests
deps:
- package
cmds:
- >
source "${VIRTUAL_ENV}/bin/activate" &&
yarn run test-e2e
interactive: true
test-ui:
desc: Run UI tests
deps:
- package
cmds:
- >
source "${VIRTUAL_ENV}/bin/activate" &&
yarn run test-ui-current
interactive: true
test-ui-old:
desc: Run UI tests (oldest vscode)
deps:
- package
cmds:
- >
source "${VIRTUAL_ENV}/bin/activate" &&
yarn run test-ui-oldest
interactive: true
package:
vars:
VERSION:
sh: node -p "require('./package.json').version"
desc: Package extension
deps:
- build
sources:
- CHANGELOG.md
- README.md
- package*.json
- out/
- webpack.config.ts
- Taskfile.yml
generates:
- "*.vsix"
cmds:
- rm -f *.vsix
- yarn run webpack
# --pre-release not supported until we do VS Code >=1.63
# --no-dependencies and --no-yarn needed due to https://github.com/microsoft/vscode-vsce/issues/439
- yarn run vsce package --pre-release --no-dependencies --no-git-tag-version --no-update-package-json {{.VERSION}}
# Using zipinfo instead of `npx vsce ls` due to https://github.com/microsoft/vscode-vsce/issues/517
- zipinfo -1 *.vsix
- tools/dirty.sh
- ls -la *.vsix
silent: true
pr:
desc: Opens a pull request using gh
deps:
- lint
cmds:
- gh pr create
interactive: true
release:
desc: Create a new release (used by CI)
deps:
- install
cmds:
- ./tools/release.sh
interactive: true