Skip to content

Commit 399bc5b

Browse files
6543qwerty287anbraten
authored
Document how to enable parallel step exec for all steps (#3605)
Document how depends_on work in more details --------- Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com> Co-authored-by: Anbraten <6918444+anbraten@users.noreply.github.com>
1 parent b0c9dfd commit 399bc5b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

docs/docs/20-usage/20-workflow-syntax.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ git commit -m "updated README [CI SKIP]"
5050

5151
## Steps
5252

53-
Every step of your workflow executes commands inside a specified container. The defined commands are executed serially.
53+
Every step of your workflow executes commands inside a specified container.<br>
54+
The defined steps are executed in sequence by default, if they should run in parallel you can use [`depends_on`](./20-workflow-syntax.md#depends_on).<br>
5455
The associated commit is checked out with git to a workspace which is mounted to every step of the workflow as the working directory.
5556

5657
```diff
@@ -484,6 +485,19 @@ Normally steps of a workflow are executed serially in the order in which they ar
484485
- go test
485486
```
486487

488+
:::note
489+
You can define a step to start immediately without dependencies by adding an empty `depends_on: []`. By setting `depends_on` on a single step all other steps will be immediately executed as well if no further dependencies are specified.
490+
491+
```yaml
492+
steps:
493+
- name: check code format
494+
image: mstruebing/editorconfig-checker
495+
depends_on: [] # enable parallel steps
496+
...
497+
```
498+
499+
:::
500+
487501
### `volumes`
488502

489503
Woodpecker gives the ability to define Docker volumes in the YAML. You can use this parameter to mount files or folders on the host machine into your containers.

docs/versioned_docs/version-2.4/20-usage/20-workflow-syntax.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ git commit -m "updated README [CI SKIP]"
5050

5151
## Steps
5252

53-
Every step of your workflow executes commands inside a specified container. The defined commands are executed serially.
53+
Every step of your workflow executes commands inside a specified container.<br>
54+
The defined steps are executed in sequence by default, if they should run in parallel you can use [`depends_on`](./20-workflow-syntax.md#depends_on).<br>
5455
The associated commit is checked out with git to a workspace which is mounted to every step of the workflow as the working directory.
5556

5657
```diff
@@ -478,6 +479,19 @@ Normally steps of a workflow are executed serially in the order in which they ar
478479
- go test
479480
```
480481

482+
:::note
483+
You can define a step to start immediately without dependencies by adding an empty `depends_on: []`. By setting `depends_on` on a single step all other steps will be immediately executed as well if no further dependencies are specified.
484+
485+
```yaml
486+
steps:
487+
- name: check code format
488+
image: mstruebing/editorconfig-checker
489+
depends_on: [] # enable parallel steps
490+
...
491+
```
492+
493+
:::
494+
481495
### `volumes`
482496

483497
Woodpecker gives the ability to define Docker volumes in the YAML. You can use this parameter to mount files or folders on the host machine into your containers.

0 commit comments

Comments
 (0)