Tasks
The tasks
section defines a list of tasks that are part of the workflow.
Each task contains a series of minimum logical actions, i.e., cubes. The result of a task is when all its cubes are completed.
Note
All cubes within a single task are run on the same VM (worker). This way, if a cube changes the worker environment, such as installs a package, creates or deletes a file, etc., such environment will still be there for all other cubes running within a single task. For example, one cube may install the runtime
package for Go, another one runs the go build
command, and the next one runs go test
. To learn more about environment variable inheritance, see Cubes.
If the cubes are run in different tasks, they are guaranteed to run on different workers.
By default, a task starts with cloning the repository.
All workflow tasks are started concurrently.
In tasks and cubes, you can use environment variables and secrets.
You can set up a particular task either within the workflows:tasks
section or in the separate tasks
section with a link to it from workflows:tasks
. The task description format for both options is the same.
Supported properties:
name
: Task name.cubes
: List of cubes to execute as part of the task. For more information, see Cubes.env
: Environment variables available to all cubes within a certain task.runs_on
: Type of worker the task will run on. By default, it will use the value fromworkflow:runs_on
. The possible values are:compute
: Cloud worker.serverless
: Serverless worker. See these examples.self-hosted
: Self-hosted worker. You can also specify a tag in this parameter; see here for an example.
Example of a task within the workflows:tasks section
workflows:
my-workflow:
tasks:
- name: my-task
cubes:
...
Example of a task in the separate tasks section
tasks:
- name: common-task
workflows:
my-workflow:
tasks:
- common-task
Example of several tasks in the separate tasks section
tasks:
- name: common-task-1
- name: common-task-2
workflows:
my-workflow:
tasks:
- [common-task-1, common-task-2]
Example of combined task specification
tasks:
- name: common-task-1
- name: common-task-2
- name: common-task-3
workflows:
my-workflow:
tasks:
- common-task-1
- [common-task-2, common-task-3]
- name: my-task
cubes:
...