From 399bc5bf1b220f30f72cb0cab22dc26787fd10ee Mon Sep 17 00:00:00 2001 From: 6543 Date: Wed, 10 Apr 2024 12:31:42 +0200 Subject: [PATCH] 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> --- docs/docs/20-usage/20-workflow-syntax.md | 16 +++++++++++++++- .../version-2.4/20-usage/20-workflow-syntax.md | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/docs/20-usage/20-workflow-syntax.md b/docs/docs/20-usage/20-workflow-syntax.md index 4e7759209..8effc3973 100644 --- a/docs/docs/20-usage/20-workflow-syntax.md +++ b/docs/docs/20-usage/20-workflow-syntax.md @@ -50,7 +50,8 @@ git commit -m "updated README [CI SKIP]" ## Steps -Every step of your workflow executes commands inside a specified container. The defined commands are executed serially. +Every step of your workflow executes commands inside a specified container.
+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).
The associated commit is checked out with git to a workspace which is mounted to every step of the workflow as the working directory. ```diff @@ -484,6 +485,19 @@ Normally steps of a workflow are executed serially in the order in which they ar - go test ``` +:::note +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. + +```yaml +steps: + - name: check code format + image: mstruebing/editorconfig-checker + depends_on: [] # enable parallel steps + ... +``` + +::: + ### `volumes` 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. diff --git a/docs/versioned_docs/version-2.4/20-usage/20-workflow-syntax.md b/docs/versioned_docs/version-2.4/20-usage/20-workflow-syntax.md index b9aad7826..59ae06444 100644 --- a/docs/versioned_docs/version-2.4/20-usage/20-workflow-syntax.md +++ b/docs/versioned_docs/version-2.4/20-usage/20-workflow-syntax.md @@ -50,7 +50,8 @@ git commit -m "updated README [CI SKIP]" ## Steps -Every step of your workflow executes commands inside a specified container. The defined commands are executed serially. +Every step of your workflow executes commands inside a specified container.
+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).
The associated commit is checked out with git to a workspace which is mounted to every step of the workflow as the working directory. ```diff @@ -478,6 +479,19 @@ Normally steps of a workflow are executed serially in the order in which they ar - go test ``` +:::note +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. + +```yaml +steps: + - name: check code format + image: mstruebing/editorconfig-checker + depends_on: [] # enable parallel steps + ... +``` + +::: + ### `volumes` 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.