-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental taskfile for running build commands
This does not make `task` an official tool for our project, it adds a config file with most commands, so we can evaluate how well it works for us and if it can address some of the confusions we had with package.json and tox.ini, as both were quite limited.
- Loading branch information
Showing
6 changed files
with
138 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,12 @@ jobs: | |
- name: Checkout vscode-ansible | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
version: 3.x | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# ~400mb, caching them should speedup test-ui execution | ||
- name: Enable test-resources caching | ||
uses: actions/cache@v3 | ||
|
@@ -92,11 +98,8 @@ jobs: | |
with: | ||
node-version: 16 | ||
|
||
- name: Run ./tools/test-setup.sh | ||
|
||
run: | | ||
./tools/test-setup.sh | ||
shell: bash | ||
- name: Run task setup | ||
run: task setup | ||
|
||
- name: Checkout ansible-language-server | ||
if: ${{ matrix.devel }} | ||
|
@@ -131,14 +134,12 @@ jobs: | |
|
||
- name: Build and package extension with released ansible-language-server | ||
if: ${{ matrix.devel == false }} | ||
run: | | ||
npm run compile | ||
npm run package | ||
run: task package | ||
|
||
- name: Run ${{ matrix.npm-target }} | ||
uses: GabrielBB/[email protected] | ||
with: | ||
run: npm run ${{ matrix.npm-target }} | ||
run: task ${{ matrix.npm-target }} | ||
|
||
- name: Publish vsix artifact | ||
if: ${{ github.event.number && matrix.upload-artifact }} | ||
|
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 |
---|---|---|
|
@@ -8,3 +8,4 @@ test-resources-oldest | |
.vscode-test | ||
CHANGELOG.html | ||
*.tgz | ||
.task |
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,117 @@ | ||
# see https://taskfile.dev/#/ | ||
version: "3" | ||
output: group | ||
vars: | ||
VERSION: | ||
sh: node -p "require('./package.json').version" | ||
tasks: | ||
default: | ||
desc: Run most commands | ||
deps: | ||
- lint | ||
- package | ||
cmds: | ||
- echo Done {{.VERSION}}! | ||
setup: | ||
desc: Install dependencies | ||
cmds: | ||
- bash ./tools/test-setup.sh | ||
- python3 -m pip install --user pre-commit | ||
- npm ci | ||
sources: | ||
- bash tools/test-setup.sh | ||
- package.json | ||
- package-lock.json | ||
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 | ||
code: | ||
desc: Forced install of extension in your code instance | ||
deps: | ||
- package | ||
cmds: | ||
- npm run package && code --force --install-extension *.vsix | ||
deps: | ||
desc: Update dependencies | ||
deps: | ||
- setup | ||
cmds: | ||
- 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 | ||
- examples | ||
- images | ||
- src | ||
- syntaxes | ||
- test | ||
- tools | ||
test: | ||
desc: Run all tests | ||
deps: | ||
- test-ui | ||
- test-e2e | ||
interactive: true | ||
test-e2e: | ||
desc: Run e2e tests | ||
deps: | ||
- setup | ||
cmds: | ||
- npm run test-e2e | ||
interactive: true | ||
test-ui: | ||
desc: Run UI tests | ||
deps: | ||
- setup | ||
cmds: | ||
- npm run test-ui-current | ||
- npm run test-ui-oldest | ||
interactive: true | ||
package: | ||
desc: Package extension | ||
deps: | ||
- build | ||
sources: | ||
- CHANGELOG.md | ||
- README.md | ||
- package*.json | ||
- out/ | ||
generates: | ||
- "*.vsix" | ||
cmds: | ||
- rm -f *.vsix | ||
# --pre-release not supported until we do VS Code >=1.63 | ||
- npx vsce package --no-git-tag-version --no-update-package-json {{.VERSION}}-next-1 | ||
silent: true | ||
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