forked from ansible/ansible-language-server
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace tox with taskfile as build tool
As neither tox nor npm are really suitable as build build, especially for mixed (ts/py) projects, we start using a task. Related: ansible/vscode-ansible#511 Related: ansible/schemas#311
- Loading branch information
Showing
8 changed files
with
196 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
--- | ||
# see https://taskfile.dev/#/ | ||
version: "3" | ||
output: group | ||
vars: | ||
VENV_PATH: '{{default ".venv" (env "VIRTUAL_ENV")}}' | ||
VENV_PYTHON: '{{if (eq OS "windows")}}{{.VENV_PATH}}/Scripts/python.exe{{else}}{{.VENV_PATH}}/bin/python{{end}}' | ||
VERSION: | ||
sh: node -p "require('./package.json').version" | ||
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: | ||
- lint | ||
- package | ||
cmds: | ||
- bash -c '{{ .NODE_ENV }} nvm install' | ||
- echo Done {{.VERSION}}! | ||
docs: | ||
desc: Build the documentation | ||
vars: | ||
envdir: ../.tox/docs | ||
temp_dir: ../.tox/docs/tmp | ||
sphinx_common_args: '-j auto --color -a -n -W --keep-going -T -d "{{.temp_dir}}/.doctrees" . "{{.envdir}}/docs_out"' | ||
dir: docs | ||
cmds: | ||
- python3 -m venv ../.tox/docs | ||
- > | ||
source ../.tox/docs/bin/activate && | ||
pip install "..[docs]" && | ||
python -m sphinx -b html {{.sphinx_common_args}} | ||
setup: | ||
desc: Install dependencies | ||
run: once | ||
cmds: | ||
- ./tools/test-setup.sh | ||
- python3 -m pip install --user pre-commit | ||
- npm ci | ||
- docker pull quay.io/ansible/creator-ee:latest | ||
- podman pull quay.io/ansible/creator-ee:latest | ||
- pre-commit --version | ||
- npm --version | ||
sources: | ||
- tools/test-setup.sh | ||
- package.json | ||
- Taskfile.yml | ||
build: | ||
desc: Build the project | ||
deps: | ||
- setup | ||
cmds: | ||
- npm run compile && sleep 1 | ||
sources: | ||
- package-lock.json | ||
- package.json | ||
- src/ | ||
- tsconfig.json | ||
- webpack.config.js | ||
deps: | ||
desc: Update dependencies | ||
deps: | ||
- setup | ||
cmds: | ||
- bash -c "PIP_CONSTRAINTS= pip-compile -q --extra docs --extra test --strip-extras --no-annotate setup.cfg -o requirements.txt" | ||
- python3 -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: | ||
PRE_COMMIT_COLOR: always | ||
cmds: | ||
- python3 -m pre_commit run -a | ||
silent: true | ||
sources: | ||
- "*.*" | ||
- .config | ||
- .github | ||
- .vscode | ||
- doc | ||
- images | ||
- src | ||
- syntaxes | ||
- test | ||
- tools | ||
test: | ||
desc: Run all tests | ||
deps: | ||
- setup | ||
cmds: | ||
- > | ||
source {{.VENV_PATH}}/bin/activate && | ||
which -a ansible-lint | ||
npm run test | ||
interactive: true | ||
test-node12: | ||
desc: Run all tests using node 12 | ||
cmds: | ||
- bash -c '{{ .NODE_ENV }} nvm use 12' | ||
- task: test | ||
test-node14: | ||
desc: Run all tests using node 14 | ||
cmds: | ||
- bash -c '{{ .NODE_ENV }} nvm use 14' | ||
- task: test | ||
test-node16: | ||
desc: Run all tests using node 16 | ||
cmds: | ||
- bash -c '{{ .NODE_ENV }} nvm use 16' | ||
- task: test | ||
test-with-ee: | ||
desc: Run only ee tests | ||
deps: | ||
- setup | ||
cmds: | ||
- > | ||
source ../.tox/docs/bin/activate && | ||
npm run test-with-ee | ||
interactive: true | ||
test-without-ee: | ||
desc: Run only non-ee tests | ||
deps: | ||
- setup | ||
cmds: | ||
- > | ||
source {{.VENV_PATH}}/bin/activate && | ||
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 | ||
- npm pack | ||
silent: false | ||
pr: | ||
desc: Opens a pull request using gh | ||
deps: | ||
- lint | ||
cmds: | ||
- gh pr create | ||
interactive: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.