Skip to content

Commit 03b00b7

Browse files
committed
Configure task dependencies to avoid redundant execution
The "Task" task runner tool is used to perform common development operations for the project. Tasks may call other tasks. Under certain conditions (most commonly when running a convenience "umbrella" which calls all tasks of a general type), this can result in the same task being called redundantly, which is inefficient. Worse, since task calls specified via the `deps` mapping of a task definition are executed concurrently, the multiple executions can conflict with each other and cause problems such as a spurious failure. This can be avoided by configuring tasks which may be called multiple times, and for which it never makes sense to execute multiple times with the same conditions, so that all but the first call will be ignored.
1 parent e4aed94 commit 03b00b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ tasks:
178178
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/Taskfile.yml
179179
docs:generate:
180180
desc: Create all generated documentation content
181+
run: when_changed
181182
deps:
182183
- task: go:cli-docs
183184
- task: go:rule-docs
@@ -494,6 +495,7 @@ tasks:
494495
Install dependencies managed by npm.
495496
Environment variable parameters:
496497
- PROJECT_PATH: Path of the npm-managed project (default: {{.DEFAULT_NPM_PROJECT_PATH}}).
498+
run: when_changed
497499
dir: |
498500
"{{default .DEFAULT_NPM_PROJECT_PATH .PROJECT_PATH}}"
499501
cmds:

0 commit comments

Comments
 (0)