forked from ansible/ansible-language-server
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Taskfile.yml
188 lines (187 loc) · 4.66 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
---
# see https://taskfile.dev/#/
version: "3"
env: &env
# basically the same thing from .envrc file:
VIRTUAL_ENV: # "{{.VIRTUAL_ENV}}"
sh: echo "${VIRTUAL_ENV:-out/venvs/${HOSTNAME:-localhost}}"
vars:
HOSTNAME:
sh: echo ${HOSTNAME:-localhost}
NODE_ENV: |
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm";
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" --silent;
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh";
tasks:
default:
desc: Run most commands
deps:
- setup
env:
VERSION:
sh: node -p "require('./package.json').version"
cmds:
- bash -c '{{ .NODE_ENV }} nvm install'
- task: lint
- task: package
- task: docs
- echo Done {{.VERSION}}!
vscode:
desc: Run vscode-ansible tests using current code from ALS
deps:
- setup
cmds:
- ./tools/vscode.sh
docs:
desc: Build the documentation
vars:
sphinx_common_args: '-j auto --color -a -n -W --keep-going -T -d "../out/.doctrees" . "../out/docs_out"'
deps:
- setup
cmds:
# Retrieve possibly missing commits:
- $(git rev-parse --is-shallow-repository) && git fetch --unshallow > /dev/null || true
- git fetch --tags
- npm run generate-settings-readme
- source $VIRTUAL_ENV/bin/activate &&
cd docs &&
python -m sphinx -b html {{.sphinx_common_args}} &&
python -m sphinx -b linkcheck {{.sphinx_common_args}} &&
python ../tools/docs_summary.py
setup:
desc: Install dependencies
run: once
env:
# used inside test-setup.sh
OS: "{{OS}}"
ARCH: "{{ARCH}}"
cmds:
- ./tools/test-setup.sh
sources:
- package.json
- .config/requirements.*
- setup.cfg
- tools/test-setup.sh
generates:
- out/log/manifest.yml
build:
desc: Build the project
deps:
- setup
cmds:
- npm run compile
sources:
- package-lock.json
- package.json
- src/
- tsconfig.json
- webpack.config.js
deps:
desc: Update dependencies
deps:
- setup
cmds:
- bash -c "PIP_CONSTRAINTS= $VIRTUAL_ENV/bin/python -m piptools compile -q --no-header --strip-extras --no-annotate .config/requirements.in -o .config/requirements.txt"
- $VIRTUAL_ENV/bin/python -m pre_commit autoupdate
# bumps some developments dependencies
- npx ncu -u --dep dev
# running install after ncu is needed in order to update the lock file
- npm install
lint:
desc: Lint the project
deps:
- setup
env:
<<: *env
PRE_COMMIT_COLOR: always
cmds:
- $VIRTUAL_ENV/bin/python -m pre_commit run -a
silent: true
sources:
- "*.*"
- .config
- .github
- .vscode
- doc
- images
- src
- test
- tools
test:
desc: Run all tests
vars:
ENGINE:
sh: bash -c "command -v podman docker | head -n 1"
deps:
- setup
cmds:
- "{{.ENGINE}} pull quay.io/ansible/creator-ee:latest"
# Tests that container engine is functional and that we have the image:
- "{{.ENGINE}} run -i quay.io/ansible/creator-ee:latest ansible-lint --version"
- >
source $VIRTUAL_ENV/bin/activate &&
command -v ansible-lint &&
bash -c '{{ .NODE_ENV }} npm run test'
interactive: true
test-node12:
desc: Run all tests using node 12
cmds:
- bash -c '{{ .NODE_ENV }} nvm install 12'
- task: test
test-node14:
desc: Run all tests using node 14
cmds:
- bash -c '{{ .NODE_ENV }} nvm install 14'
- task: test
test-node16:
desc: Run all tests using node 16
cmds:
- bash -c '{{ .NODE_ENV }} nvm install 16'
- task: test
test-with-ee:
desc: Run only ee tests
deps:
- setup
cmds:
- >
source $VIRTUAL_ENV/bin/activate &&
bash -c '{{ .NODE_ENV }} npm run test-with-ee'
interactive: true
test-without-ee:
desc: Run only non-ee tests
deps:
- setup
cmds:
- >
source $VIRTUAL_ENV/bin/activate &&
bash -c '{{ .NODE_ENV }} npm run test-without-ee'
interactive: true
package:
desc: Package extension
deps:
- build
sources:
- CHANGELOG.md
- README.md
- package*.json
- out/
generates:
- "*.vsix"
cmds:
- rm -f *.tgz
- bash -c '{{ .NODE_ENV }} npm pack'
silent: false
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:
- setup
cmds:
- ./tools/release.sh
interactive: true