Task in CI: Installing and Running Tasks
In CI you install the Task binary, then run task <name> for each pipeline step.
Task fits CI well because the YAML lives in the repo and each step is one line. Setup is just installing the binary and choosing a sensible output mode.
What it does
A pipeline installs Task (via a setup action, the install script, or a package manager), then runs tasks as steps: task lint, task test, task build. --output group reformats interleaved parallel output so logs stay readable. Task exits non-zero when a task fails, failing the step.
Common usage
# GitHub Actions
- uses: arduino/setup-task@v2
with:
version: 3.x
- run: task --version
- run: task test
- run: task build
# install via the official script (any runner)
sh -c "$(curl -ssL https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
task --output group test -- -run TestFooSyntax
| Step / flag | What it does |
|---|---|
| setup-task action | Installs the Task binary on a runner |
| task --version | Records the version in the log |
| task <name> | Runs a task as a pipeline step |
| --output group | Group parallel output for readable logs |
| task <name> -- <args> | Pass args through as {{.CLI_ARGS}} |
In CI
Pin the Task version in the setup action so schema features are stable across runs. Use --output group when tasks run things in parallel so the log is not interleaved line-by-line. Forward filters with -- so one task handles many matrix cases.
Common errors in CI
"task: command not found" means the install step was skipped or the binary is off PATH. "task: No Taskfile found" means the wrong working directory; pass --taskfile or set it. A version mismatch can yield "task: Taskfile schema version ... not supported" when the runner has an older Task than the file requires; pin the version.